At the same time, Mr. Khosrowshahi continued to present himself as a low-key and steady hand. The fact that he was not publicly campaigning for the job — his name had not surfaced in the media — helped his cause.

Mr. Khosrowshahi said of the recruitment process: “When I was at Uber, they asked me if I knew my passenger rating.”

Ms. Whitman also had many positives in her favor. Benchmark liked her track record of imposing order on a company, along with her no-nonsense approach to governance.

Yet others, like Mr. Kalanick, were wary. Mr. Kalanick viewed Ms. Whitman as potentially compromised by her strong affiliation with Benchmark, which has sued Mr. Kalanick for board control. (On Wednesday, lawyers for Benchmark and Mr. Kalanick will meet in Delaware Chancery Court over whether the case will go to arbitration.)

Some of Ms. Whitman’s points to board members did echo Benchmark’s. At one point, she suggested to Uber directors that it would behoove the company to box out Mr. Kalanick.

Throughout the recruitment, directors had agreed to pick their first- and second-choice candidates. While many leaned toward Ms. Whitman as a first choice, all of the directors continued including Mr. Khosrowshahi in their selections. Still, Ms. Whitman appeared to have an edge.

After Mr. Immelt dropped out on Sunday morning, things changed. Ms. Whitman, as the front-runner, negotiated for conditions including limiting Mr. Kalanick and potentially reshaping the board of directors. She also wanted an end to the lawsuit between Mr. Kalanick and Benchmark.

“I said Benchmark and Travis needed to settle their lawsuits and the board needed to put in place a functioning governance structure,” Ms. Whitman said in a statement on Tuesday to The New York Times.

She added that “the directors, including Travis, seemed eager to take those steps on Saturday and Sunday morning, but by midday Sunday it was becoming clear that the board was still too fractured to make progress on the issues that were important to me.”

Directors were put off by Ms. Whitman’s tactics. A consensus grew among Uber board members that Mr. Khosrowshahi was a stronger candidate who came with fewer potential headaches.

By Sunday evening, that conclusion had hardened into a unanimous vote for Mr. Khosrowshahi.

The board also agreed to hold the news until it had time to formally offer Mr. Khosrowshahi the job and tell Uber employees that he had accepted. After months of turmoil surrounding the company, it was the least directors could do to instill confidence among the rank and file.

Minutes later, news of the board’s decision leaked.