Many tech stocks are well below their all-time highs today, in part because of a growth slowdown compared to some of the huge gains they achieved during the pandemic. A demand hangover is occurring in niches like digital advertising and consumer electronics, causing many companies to scramble to cut costs in response. That's why it's no surprise that the Nasdaq Composite is down sharply since the start of 2022.

The stock of Microsoft (MSFT -0.42%) has bucked that trend by declining only slightly. Zooming out, shares are up a blistering 835% since early 2013, a 10-year period that captures the entire pandemic time frame to date. A moderate $10,000 investment a decade ago, then, would have turned into $93,500 today.

Let's take a closer look at some factors that helped shareholders earn those impressive returns.

A diverse tech portfolio

An investment in Microsoft delivers exposure to a wider range of growth industries in the tech world, and many of these have been booming in the past decade. The biggest niche is enterprise cloud services, but shareholders also benefited from more spending on productivity software, cybersecurity, and video games.

Investors are excited about Microsoft's foothold in areas like artificial intelligence (AI), virtual reality, and cloud computing. Some of these growth bets will deliver subpar returns in any given year, but the wider portfolio is among the most attractive in the tech world.  

Profitability

Microsoft's stock returns wouldn't have been nearly as strong if the company struggled with profitability challenges. Fortunately, its dominant market position and massive scale make that a non-issue for shareholders.

MSFT Operating Margin (TTM) Chart

MSFT operating margin (TTM) data by YCharts. TTM = trailing 12 months.

Sure, Microsoft's profit margin has declined from the all-time high set during the pandemic, when demand was soaring for digital work and play products. But the company's 41% operating margin still towers above tech peers like Apple. It is also meaningfully higher over the past decade. Maintaining or expanding this metric is key to investors' future returns.

Cash returns

The other key factor supporting Microsoft's stock price has been cash returns. The company spent $28 billion repurchasing its stock in 2022 after having spent $23 billion in the prior year. These returns are bolstered by a modest but growing dividend payment.

Repurchases are trending lower in 2023 at $11 billion through the first half of the year compared to $15 billion in the same period last year. But shareholders are still likely to see overall returns boosted by this spending, which amplifies earnings per share over time.

Looking ahead

Investors can't know what the next decade will bring for tech innovations. New, exciting niches will see soaring interest at times, often just before excitement evaporates. Wall Street isn't nearly as interested in the metaverse today, for example, as it was a year ago.

That unpredictability is the best reason to like Microsoft stock even after its rally over the past decade. Investors can't find many other investments that deliver promising exposure to such a wide range of tech niches in one purchase. And with Microsoft, you get the added benefit of market-beating profitability and ample cash returns.

Sure, its massive market capitalization means Microsoft isn't likely to greatly expand its sales footprint over the next decade. But shareholders might still see excellent returns by simply holding this tech stock over the long term.