When Williams asked Dorsey to send a companywide e-mail setting Twitter’s goals, his first draft began with the subject line “3 things I want for Twitter (Goals),” each goal beginning with an off-putting “I.” Dorsey often tried to act as if he were in control, posturing that his actions were all part of a bigger plan, but employees saw him frequently pacing in frustration around South Park. He also habitually left around 6 p.m. for drawing classes, hot yoga sessions and a course at a local fashion school. (He wanted to learn to make an A-line skirt and, eventually, jeans.) His social life, once virtually nonexistent, was becoming a distraction as venture capitalists wooed him at San Francisco Giants baseball games and parties throughout the city. On Dorsey’s watch, Twitter, which had never been completely upgraded from its prototype, was suffering major infrastructure problems that regularly knocked the site offline for hours at a time.

One summer afternoon, Williams asked Dorsey to meet him in the upper-floor conference room that the Twitter gang referred to as Odeo Heights. They opened the door to the small room, pulled back the chairs across from each other and sat, hands clasped as they had dozens of times before. “You can either be a dressmaker or the C.E.O. of Twitter,” Williams said to Dorsey. “But you can’t be both.”

Dorsey seethed silently as Williams ticked off his grievances. But their dispute over Dorsey’s management illuminated a far deeper disagreement. Dorsey still believed that Twitter was primarily a service through which people could talk about themselves by updating their at-the-moment status. Williams worried that simply appealing to people’s egos would make Twitter too ephemeral. After seeing how users responded to a series of events that year, including an earthquake and a car crash, he was coming to a different conclusion — one that was much more in line with what Glass had thought from the beginning. Twitter was a service for people to talk about what was going on around them, to share news and information. It was when Williams explained this concept — eventually saying Twitter was about “what’s happening” — that many in the industry, including those who once dismissed it, started to understand its potential.

The conversation ended awkwardly, but Twitter was getting so much attention that Dorsey and Williams had no choice but to work, if not together, then at least next to each other. Often they were both acting as chief executive. In June 2008, when it came time to raise a new round of financing, some investors were confused when they received separate phone calls from Williams, the company’s chairman, and Dorsey, its chief executive, sometimes moments apart. Eventually, Williams decided that the main investor would be Spark Capital, which was leading an $18 million investment in the company. Bijan Sabet, a well-respected partner, would soon join the board.

Initially, Sabet and the venture capitalist Fred Wilson, another board member, were concerned by some of Dorsey’s decisions. He pushed people to use Twitter over text message, which produced a monthly bill for the company approaching six figures. Dorsey had also been managing expenses on his laptop and doing the math incorrectly. Beyond that, it became clear that there was no backup of some key components. If the site went down, significant data could be lost. Williams and Dorsey started meeting for weekly dinners to discuss the problems, but one night Dorsey became defensive. “Do you want to be C.E.O.?” he said abruptly. Williams tried to evade the question, but eventually replied: “Yes, I want to be C.E.O. I have experience running a company, and that’s what Twitter needs right now.”

Dorsey raced home to try to figure out a plan for his resignation, but the Twitter board instead offered him a three-month window to fix the site and its issues. Not much changed, however, even as text bills mounted, and the site continued to crash. Before the three months were up, Dorsey recalled, Sabet and Wilson took him to a breakfast at the Clift hotel and told him that they were replacing him as C.E.O. with Williams. Dorsey sat before a bowl of uneaten yogurt and granola as he was offered stock, a $200,000 severance and a face-saving role as the company’s “silent” chairman. No one in the industry had to know that he was fired. (Investors would not want to be seen as pitting one founder against another anyway.) But Dorsey had no voting rights at the company. He was, essentially, out.

The timing of the departure was particularly fraught. For weeks, Facebook had been quietly exploring the possibility of buying the fledgling company, and while Dorsey was intrigued, Williams was not. The day after he was ousted, Dorsey called Zuckerberg to confidentially share the news. To Dorsey’s surprise, Zuckerberg asked if there was a way to prevent the firing, perhaps in order to save the deal. Dorsey assured him that there wasn’t, and Zuckerberg switched his plan from trying to buy Twitter to trying to hire Dorsey. So Dorsey met with Chris Cox, who ran Facebook’s product division, at a Philz Coffee in San Francisco. The discussions soon became more serious. But they didn’t have a specific role in mind. Zuckerberg wanted Dorsey to simply join Facebook in an unspecified capacity, and they would worry about a position later.