Marissa Mayer, the president and C.E.O. of Yahoo, in November. Photograph by Justin Sullivan/Getty

Soon after Marissa Mayer became the C.E.O. of Yahoo, in 2012, she looked up a list of the most popular activities that people did with their phones. Yahoo’s mobile business barely existed at the time, generating so little revenue that the company didn’t even report the amount in financial filings. When Mayer read the list, though, she was buoyed. Besides habits like talking and texting, which were services that cell-phone carriers typically provided, people spent a great deal of time e-mailing, checking the weather, reading the news, sharing photos, getting financial information, looking up sports scores, and playing games. A company that offered these services should be able to get people to use its products. “Does that sound like any particular company that you know?” she asked in her first public conference call to discuss Yahoo’s earnings. To succeed, she said, “Yahoo will have to be a predominantly mobile company.”

Last week, Mayer all but acknowledged that this effort hadn’t borne fruit, when she announced, in a call to discuss the company’s fourth-quarter earnings for 2015, that it would cut fifteen per cent of its workforce and explore “strategic alternatives”—a phrase that, along with other similar comments, was widely interpreted as a reference to putting Yahoo up for sale. The earnings filing included a particularly telling figure: mobile revenue had brought in two hundred and ninety-one million dollars during the quarter, or about twenty-three per cent of Yahoo’s total revenue. That was a big increase from the pre-Mayer days, but, relative to Yahoo’s competitors, it still wasn’t much. In the same quarter, Facebook brought in four and a half billion dollars—about eighty per cent of its total advertising revenue—from its mobile business. Google doesn’t break out its mobile revenue, but it’s believed to total many billions of dollars. The research firm eMarketer estimates that Google holds a thirty-four per cent share of the global market for mobile ads—more than any other company—compared with seventeen per cent for Facebook and less than two per cent for Yahoo.

Mayer was clearly aware of Yahoo’s mobile problem when she arrived there, nearly four years ago. Why was she unable to solve it?

The challenge was always going to be tough. During the two-thousands, Yahoo had increasingly identified itself not as a traditional tech company but as a media company that created content—news, sports statistics, financial data—that was distributed online, with the idea that Yahoo could sell advertising against the material it published. Mayer was aware, when she started, that Yahoo had failed to capture much of an audience for this content on smartphones. As Shashi Seth, who was a senior executive at Yahoo from 2010 to 2013, told me, its mobile troubles stemmed largely from one problem: unlike Google and Apple, Yahoo had neither a mobile operating system nor a widely used browser of its own. Seth, who was at one point responsible for the company’s search, e-mail, and messenger services, among others, explained that Yahoo lacked a “front door” through which smartphone users might access—and, more to the point, be led to—the company's own services and apps. Google, by contrast, had its Android operating system, which it had begun work on in the mid-two-thousands. When Android devices started selling, in 2008, they came bundled with Google’s search function and some of its other apps.

It was too late for Yahoo to try to match that kind of advantage, so Mayer decided to focus on an area where she still had control: the apps themselves. The company still had millions of users—who mostly used the company’s services to check e-mail and search the Internet—but this advantage was rapidly dissipating as people’s habits shifted toward phones, an area in which Yahoo’s products hadn’t been successful. Yahoo’s engineers were already working on a large number of apps, to try to bridge the gap, but the company’s efforts were unfocussed, and the results hadn’t been very good.

Mayer identified a few reasons why. First, Yahoo didn’t employ enough mobile engineers. Second, it had put too many resources into too many apps, when it should have been focussed on making a small number of apps excellent. And, third, its engineers were using HTML5, a programming language that let them build apps that worked fine on most mobile devices, but that tended not to be especially well tailored to any single mobile operating system. Mayer went on a hiring and acquiring spree, increasing the number of mobile programmers the company employed from about fifty to five hundred. She dedicated resources to redesigning Yahoo’s most popular apps—including the ones for e-mail, weather, finance, and sports—and on creating “native” apps built for each major smartphone operating system.

Those apps did get better, acquiring more users in the process. But the choice to dedicate so many resources to them may have followed too closely from Mayer’s 2012 analysis of how people were using their phones, when what was needed was a far-sighted assessment of how smartphone habits were changing. During the past few years, success in mobile has come to be measured by how much time people spend using a given app, because that’s what persuades brands to pay more to advertise on them. Today, when we use our phones, we spend more and more time using communication-based apps. Apps that provide content-based services tend (with some exceptions, like Pandora) to be less successful—it doesn’t take long to check the weather, after all.

Facebook, for its part, benefitted greatly from this shift. In 2012, it, like Yahoo, had an all-but-nonexistent mobile business, no operating system, and no Web browser. But it did have a popular communications app, which people checked compulsively, often for hours each day, because they wanted to stay in touch with their friends. In subsequent years, the company built on its communications expertise, acquiring Instagram and WhatsApp, and turning its own Messenger feature into a stand-alone app.

Mayer did make two significant investments in this area. She overhauled Yahoo Mail, which was, by far, Yahoo’s most-used communications tool, and therefore might have been the best bet to do something similar to Facebook. (Yahoo’s own, once-popular messenger service had fallen into disuse.) Mayer’s other big bet was Yahoo’s purchase of Tumblr, in 2013, for more than a billion dollars. Tumblr also had potential to give the company an app that people might use to communicate; hundreds of millions of users followed and reblogged one another on the platform, just as they did, for instance, on Twitter. But Tumblr had begun mainly as a publishing platform, and, at Yahoo, it stayed just that. Yahoo also made several other, much smaller acquisitions of mobile companies, but Mayer, who was seemingly most interested in acquiring their talented engineers, let many of those companies’ products fade.

To her credit, Mayer has managed to triple Yahoo’s mobile audience, but the total number has remained too small to transform the company in a meaningful way. With Yahoo now in serious danger, there’s a lot of talk in Silicon Valley about what went wrong. Was Mayer a bad boss? Did she make a mistake in buying Tumblr? Did she err in thinking of Yahoo as a media company rather than a technology one? But the simplest explanation is one that follows from the plan she set in motion after becoming C.E.O. By failing to transform Yahoo into a mobile company, Mayer failed to meet her own goal.