It's not exactly a secret that Amazon (AMZN 1.34%) is one of the best-performing stocks of the past decade. Indeed, despite being a relatively young company, Amazon is one of the market's most rewarding stocks of all time.

As the old adage goes, though, past performance is no guarantee of future results. This company superficially seems to be running out of ways to keep growing at the same pace it has in the past. The stock's recent move to a new 52-week high further undermines the bullish case for stepping into it now.

Just don't talk yourself out of buying Amazon stock if you don't already own it. Its future may not look anywhere near as compelling as its past. However, the e-commerce giant has plenty of upside left to dish out to shareholders for a couple of reasons.

The business of selling stuff online is evolving

Amazon's highest-growth days are in the past. The stock's near-200,000% gain since it went public back in 1997 won't likely be repeated over the course of the next 26 years now that competitors are figuring out how to compete with Amazon. Much of the addressable e-commerce market has already been tapped anyway. Besides, between its competitive prices, a huge network of warehouses, and steep logistics expenses, it's not like profit margin rates were ever really all that great for Amazon's e-commerce operation.

But e-commerce isn't the core of this company's future, at least not directly. Rather, it's just a means to an end.

Amazon's been doing it for a while, but it's only been within the past couple of years that the e-commerce behemoth has made the most of its advertising opportunity by accepting payments from its third-party sellers in exchange for prominently featuring their particular products. If you've ever shopped at Amazon.com, there's a reason the "sponsored" listings are usually the first ones you see while searching. All told, Amazon collected a little over $12 billion worth of ad revenue during the three-month stretch that ended in September, bringing the trailing-12-month tally to $43.8 billion. That's up 22% year over year.

It's still only a drop in the bucket compared to the $528 billion worth of business Amazon is expected to do this year. This new business model changes everything about the company's existing business, however. Advertising revenue is high-margin revenue; it's conceivable that Amazon.com could generate more profit as an advertising platform than as an operator of an enormous online mall. Indeed, the company could lose money outright on the sale of goods and still more than offset those losses with ad revenue.

In this vein, market research outfit Insider Intelligence believes Amazon's advertising business will grow to just under $45 billion for the fiscal year ending this month, en route to $67.6 billion in 2025. Even then, though, it's just getting started. Insider Intelligence goes on to say the United States' entire retail media ad market -- the practice of charging brands to be featured at an online shopping website -- will swell from a total of $46.4 billion this year to over $109 billion in 2027.

Given that Amazon.com alone accounts for around 40% of the nation's e-commerce revenue and draws far more traffic than any of its rival shopping sites, it stands to reason that the company is positioned to capture more than its fair share of this growth.

We've only scratched the surface of the cloud computing market

The other reason Amazon stock is a buy despite the saturation of the low-margin e-commerce market: Cloud computing.

You likely know Amazon Web Services (AWS) is a contender in the cloud computing arena. Technology market research firm Canalys says Amazon's AWS leads this market, with a 31% share of worldwide cloud infrastructure revenue. What you may not realize is what impact it has on Amazon's bottom line. Although AWS's sales only make up around 16% of the company's top line, its cloud computing arm accounts for around three-fourths of Amazon's companywide profits -- a proportion that's been in place for several years now.

Amazon Web Services' contribution to the bottom line is only apt to get bigger as time marches on, too.

As big as the cloud computing market has already become, it's going to continue growing at a jaw-dropping clip for a while. Precedence Research believes the global cloud services market will expand at an annualized pace of 17% through 2023; Straits Research pegs the compound annual growth rate at nearly 19%. Both outlooks put the world's cloud computing market in the ballpark of $2 trillion by the early 2030s.

That's huge for Amazon. Even if the company loses a bit of its cloud market share, the industry's brewing expansion could nearly quadruple AWS' revenue during the next 10 years. Amazon Web Services' yearly operating profits should swell accordingly to around $100 billion.

Yes, Amazon stock is a buy now

Amazon stock's recent run-up is intimidating, to be sure, and so is its valuation. Shares are priced at a trailing price/earnings ratio of nearly 80 and a forward-looking P/E of nearly 40. Both are frothy by marketwide standards.

Amazon was never a stock that respected marketwide standards, though. It's always been priced richly and usually performed well despite its steep valuation. That's because investors are willing to pay for its above-average growth potential and the above-average assurance that Amazon will be able to deliver on its promise. That hasn't changed, even if the way it will achieve this growth has evolved away from e-commerce and toward business-oriented services.

This might help: Despite the stock's bullishness since October's low (and really, its late-2022 low), the analyst community still believes there's much more upside in store. Of the 57 analysts monitoring Amazon stock, 48 rate it a strong buy. The analyst community also sports a consensus price target of $176.44, nearly 20% above the stock's present price.

Take the hint.