Microsoft (MSFT 0.23%) was once considered a mature tech stock that was owned for stability and income instead of growth. But over the past five years, Microsoft stock rallied roughly 300% as a visionary CEO turned its business upside down.

Satya Nadella, who succeeded Steve Ballmer in 2014, reduced Microsoft's dependence on sales of Windows and Office licenses and expanded its ecosystem with a "mobile first, cloud first" mantra. Nadella ditched the company's Windows Phone and smartphone ambitions, launched mobile versions of its apps on iOS and Android, and aggressively expanded its cloud services.

A Microsoft Store.

Image source: Microsoft.

That transformation initially throttled earnings growth, but it paid off as the commercial cloud business -- which included Office 365, Dynamics 365, and Azure -- became its new growth engine. Microsoft also expanded its Surface and Xbox businesses to maintain a healthy presence in the PC and gaming markets, respectively.

Those strengths buoyed Microsoft's results throughout the COVID-19 crisis, and its stock has risen nearly 11% year to date even as the S&P 500 slipped over 12%. But looking further ahead, will Microsoft continue to outperform the market?

Microsoft's core strengths

Windows accounts for nearly 80% of the desktop OS market, according to StatCounter, while Office controls nearly 90% of the authoring and email market, according to Gartner. Microsoft leveraged its dominance of both markets to transform Windows and Office into cloud-based services. Microsoft initially gave Windows 10 away as a free upgrade; the addition of an app store and cloud-based updates make it more similar to iOS and Android.

Microsoft CEO Satya Nadella.

Image source: Microsoft.

Microsoft then transitioned Office users away from periodic upgrades to a subscription-based model with Office 365 and expanded its Dynamics CRM (customer relationship management) platform as a cloud-based service. It also expanded Skype to compete against Slack, and acquired LinkedIn to lead the niche market of professional social networks.

To support these services and the cloud storage and processing needs of enterprise customers, Microsoft expanded its cloud infrastructure platform Azure, which now ranks second in the market after Amazon Web Services (AWS).

Azure's market share grew from 14.6% to 17.6% between the fourth quarters of 2018 and 2019, according to Canalys, as AWS' share dropped from 33.4% to 32.4%. Microsoft also notably won the coveted $10 billion JEDI cloud contract from the Pentagon, although Amazon is trying to delay the deal with a lawsuit.

In the hardware market, Microsoft forced the laptop market to evolve with the Surface, which created a new niche of 2-in-1 devices. And it continues to challenge Sony in the gaming console market with the Xbox One and expanded into the augmented reality space with the HoloLens. It also wisely divested most of its display advertising business and partnered with Apple to showcase its productivity apps on iOS.

Microsoft's main weaknesses

Microsoft's commercial cloud revenue surged 39% annually in its fiscal second quarter and accounted for over a third of its top line, but the business still faces tough competition from AWS and other rivals in the cloud platform market, Salesforce in the cloud CRM market, and numerous smaller companies -- including Slack and Zoom -- in the cloud-based collaboration market.

Microsoft's more personal computing segment, which generated 36% of its revenue last quarter by selling Windows licenses, hardware devices, Xbox consoles, and its search-based ads, also remains exposed to macro headwinds more than its cloud business. Microsoft pulled its guidance for the unit in late February, and it's unclear if the growth of its cloud services can offset that slowdown.

Microsoft's gaming revenue also declined over the past year, as customers postponed their hardware upgrades ahead of the launch of the Xbox Series X in late 2020. However, Microsoft sold fewer Xbox Ones than Sony sold PS4's over the past five years, and that gap could widen if Microsoft fumbles the upcoming launch.

So how much higher can the stock soar?

Wall Street expects Microsoft's revenue and earnings to rise 12% and 18%, respectively, this fiscal year. The stock isn't cheap at nearly 30 times forward earnings estimates, but Microsoft's strengths -- especially in the cloud market -- arguably justify that premium valuation.

Microsoft already has a massive market cap of $1.33 trillion, so it might not be realistic to expect multibagger returns over the next five years. However, the stock can still climb higher as its "mobile first, cloud first" strategy offsets the waning importance of its legacy businesses.