Yet the two men almost never spoke. They clashed through proxies. Over the course of the past year, a series of slights — accidental, calculated, impulsive, imagined — drove a schism between them, according to numerous interviews with government officials, transit executives and business leaders.

“Andy Byford won the hearts of New Yorkers with his clear intention to make this the best transit system in the world,” Ms. Wylde said. “But it was naïve of him to think that this governor, who has put his credibility on the line, would rely on any one person to do the job.”

Neither Mr. Byford nor Mr. Cuomo has had a cross word for the other in public, before or after the resignation. But even before the October letter, Mr. Byford had threatened to quit on more than one occasion.

Reached late last week, Mr. Byford said he was grateful to Mr. Cuomo for bringing him to New York. The subway system last month had an on-time rate of 84 percent, he said, up from 58 percent in 2018.

“I get the attention, but a good leader builds a good team,” Mr. Byford said. “I will have failed if it all falls apart when I leave, but I’ve left it in good hands, with a good plan.”

Mr. Cuomo said Mr. Byford’s departure would not hobble the system’s recovery. “There has been amazing progress made at the M.T.A. with new laws, financing and its reorganization,” the governor said. ‎“All arrows are pointed up and with new projects coming on line and new resources, the best lies ahead.”

The governor has said he did not want Mr. Byford to leave, but behind the scenes, the distance between the two men widened through the past year.