Amazon (AMZN -0.17%) looks like one of the most exciting stocks to own over the next several decades. But don't be fooled: This excitement has nothing to do with the company's e-commerce business that currently contributes most of its revenue.

Instead, there's another business segment that most investors aren't familiar with. This division should grow by leaps and bounds for years to come thanks to a massive rise in artificial intelligence spending.

Amazon is one of the best AI stocks right now

Right now, Amazon sits at the center of the ongoing AI revolution. It implemented AI solutions throughout much of its e-commerce division. But it really is Amazon Web Services -- commonly referred to simply as AWS -- that is the true winner.

AWS is essentially a global cloud infrastructure provider. When an AI developer wants to train a model, for instance, they rarely build out their own infrastructure. It would be far too inefficient when it comes to cost and lead times for each developer or AI business to construct independent facilities. Instead, they almost always rent from a cloud infrastructure provider like AWS. This lets them scale up their needs dynamically at the press of a button, executing commands on a distributed global computer rather than a local device.

Thanks to early investment, AWS is now the largest cloud infrastructure business in the world. The division has a roughly 30% global market share, nearly as much as the next two competitors (Microsoft's Azure and Alphabet's Google Cloud) combined. This scale gives AWS several major advantages.

First, AWS has greater global reach when it comes to data center locations. This geographic proximity can provide developers with lower latency times as well as more options for delivering data to end users around the world. Second, scale allows AWS to either charge less for its services or generate higher operating margins. In a business where scale matters a lot for profitability -- especially for fairly commoditized cloud services -- AWS has an enviable lead.

Finally, AWS' scale likely gives it greater bargaining power when it comes to suppliers. For example, when Nvidia announced its new Blackwell chip architecture, a 12-month waitlist quickly formed. Amazon's scale likely gives it a small advantage here in sourcing highly coveted chips like this, granting it an ability to better meet user demand for next-gen performance.

With the AI market expected to grow by more than 30% per year over the next decade or more, AWS is in a prime position to benefit. But could the value of AWS eventually exceed the value of Amazon's e-commerce division?

Data center with blue lights.

Image source: Getty Images. 

AWS could become a multitrillion-dollar business

For those in the know, Amazon's AWS division has been an exciting thing to watch for years. In 2022 -- arguably before the current AI revolution had taken off to a significant degree -- Alex Haissl, an analyst at Redburn, predicted the AWS division alone would soon be worth more than $3 trillion. For comparison, Amazon's total market cap today is around $2.3 trillion.

Haissl predicted that the AWS division could eventually become a spinoff given the strength of this segment was being overshadowed by relative weakness in the e-commerce division, which has long demonstrated lower growth and profitability. "Separating AWS may not be on the table for now, but if the performance gap versus the non-AWS parts continues to widen, it could be on the table further down the road," he explained.

Fast-forward to today and Haissl's predictions look pretty spot on. Thanks to the AI revolution, AWS is growing revenues by 15% to 20% per year, roughly double the growth of the e-commerce division. Plus, AWS is posting its highest profit margins in over a decade, a strength that is allowing it to contribute most of Amazon's operating profit despite pulling in significantly less revenue than the e-commerce division.

According to analysts today, AWS remains Amazon's "crown jewel." It should allow Amazon to tap into the high and sustained growth rates expected from the AI market, making shares a comfortable long-term buy for those looking to maximize their retirement nest egg.