Microsoft's (MSFT 0.46%) stock price has risen more than 450% over the past five years. After factoring in reinvested dividends, the tech giant generated a total return of nearly 500% -- compared with the S&P 500's total return of about 130%. That massive rally boosted Microsoft's market cap to nearly $2.6 trillion and made it one of the world's most valuable companies.

So how did Microsoft, which was considered a mature tech stock a decade ago, become a growth stock again? These five charts tell the tale.

Microsoft CEO Satya Nadella.

Image source: Microsoft.

1. A new era of revenue growth

Between fiscal 2011 and 2016, Microsoft's annual revenue grew at a compound annual growth rate (CAGR) of just 4.1%. But between fiscal 2016 and 2021, its revenue rose at a CAGR of 14.5%.

MSFT Revenue (TTM) Chart

Source: YCharts

The architect of that growth spurt was Satya Nadella, who succeeded Steve Ballmer as Microsoft's third CEO in 2014. Instead of focusing on desktop-based software, Nadella adopted a "mobile first, cloud first" strategy to launch more mobile apps while expanding Office 365, Dynamics, and Azure as the core growth engines of its cloud-based ecosystem.

Under Nadella, Microsoft's annualized commercial cloud revenue rose from $12.1 billion (14% of its revenue) in fiscal 2016 to $69 billion (41% of revenue) in fiscal 2021. That expansion also turned Azure into the world's second-largest cloud infrastructure platform after Amazon Web Services (AWS).

2. A long-term expansion of its operating margins

Shortly after Nadella took over, Microsoft closed its $7.2 billion purchase of Nokia's handset unit, which Ballmer had orchestrated in a desperate 11th-hour attempt to save the Windows Phone platform.

A year later, Nadella shut down most of that business, took a $7.6 billion writedown on the deal, and focused on launching more mobile apps for iOS and Android instead. That same year, Microsoft launched Windows 10 as a free upgrade for most of its Windows users and continued to invest heavily in the expansion of Azure and its other cloud services.

All those decisions squeezed Microsoft's operating margins throughout Nadella's first two years at the helm. But after weathering those initial expenses, Microsoft's operating margins improved significantly as its cloud revenue soared and economies of scale kicked in:

MSFT Operating Margin (TTM) Chart

Source: YCharts

3. Explosive earnings growth

Microsoft's rising revenue and expanding margins naturally boosted its profits. Between fiscal 2011 and 2016, Microsoft's annual net income declined at a negative CAGR of 6.2%. But between fiscal 2016 and 2021, its annual net income increased at a CAGR of 29.5%:

MSFT Net Income (TTM) Chart

Source: YCharts

Microsoft's diluted earnings per share (EPS), which were slightly boosted by buybacks, also rose at a CAGR of 30.8% between fiscal 2016 and 2021.

4. Rising dividends

Microsoft's stable earnings growth has enabled it to raise its dividend every year for more than a decade:

MSFT Dividend Chart

Data source: YCharts

It currently pays a forward dividend yield of 0.7%, and it spent just 28% of its free cash flow (FCF) on that payout over the past 12 months. That low cash dividend payout ratio gives it plenty of room for future dividend increases.

5. But its valuation is also rising

Analysts expect Microsoft's revenue and earnings to grow another 17% and 14%, respectively, this year. Those are impressive growth rates for a 46-year-old company, but the stock is also getting a bit pricey at 37 times forward earnings.

If we look at Microsoft's trailing price-to-earnings ratio -- and then exclude its temporary earnings declines in fiscal 2015, 2016, and 2018, all caused by higher investments and restructuring expenses -- we'll notice its valuation has been steadily rising over the past decade.

MSFT PE Ratio Chart

Source: YCharts

The bulls will argue that Microsoft's robust growth justifies that premium valuation. However, the bears will argue that Microsoft's high P/E ratio could limit its upside potential -- especially as inflationary headwinds reduce the market's appetite for higher-growth tech stocks.

Is Microsoft's stock still worth buying?

Microsoft's stock isn't cheap, but I believe it's still worth buying as long as Nadella remains in charge. Nadella's vision for a "mobile first, cloud first" future is paying off, and it's setting up the foundations for Microsoft's future growth in next-gen markets such as augmented reality and cloud gaming. Those long-term strengths, along with its resilience during past economic downturns, could easily support its higher multiple for the foreseeable future.