While Nvidia and Microsoft are duking it out to see which company will maintain its position as the largest in the world by market cap, another competitor is lurking in the background: Amazon (AMZN -1.54%).

Amazon is a dark horse pick to become the largest company in the world in a few years, because it has several divisions that are growing at an impressive rate while producing stellar profits. But does it have enough juice to overtake the current leaders by 2030? Let's take a look.

Person looking at a laptop.

Image source: Getty Images.

Amazon's growth comes from two business units

Amazon is more than just the e-commerce platform you interact with when shopping. There is a lot that goes into selling products online, as well as delivering them to your doorstep, but none of those aspects excite me about the stock.

Instead, I'm most interested in the company's advertising and cloud computing segments. Its advertising wing was nearly nonexistent five years ago. Now, it has grown into its fourth-largest segment, behind online stores, third-party seller services, and Amazon Web Services (AWS). It's also the fastest-growing segment, with revenue rising 18% in the first quarter.

The company has some of the most valuable consumer data available, like direct information about shopping habits. This makes its ad data incredibly powerful, which is why management was smart to monetize it.

Another reason this segment is so important is its increased margins. The company doesn't break down the margins of its individual operations, and advertising gets grouped into Amazon's North American and International commerce segments. But from examining advertising-focused businesses like Meta Platforms, it's clear that this division likely has an incredibly high operating margin.

This is crucial for Amazon's future because the faster growth of higher-margin segments will allow profits to increase rapidly.

This same dynamic is occurring in AWS' cloud computing segment, which is benefiting from two major trends: a general migration from on-premises to cloud-based solutions and the increasing adoption of AI workloads.

Both of these create huge growth catalysts for AWS and are why it produced solid 17% growth in the first quarter. Fortunately for investors, Amazon breaks out its margins. In the first quarter, AWS' operating margin was an impressive 39%. Although it accounted for 19% of overall revenue, it contributed 63% of the company's total operating profits.

As long as AWS continues to deliver rapid growth, Amazon's profits will rise much faster than its overall revenue, which is what we've seen play out over the past few years with the stock, although that trend is starting to slow somewhat.

AMZN Operating Revenue (Quarterly YoY Growth) Chart

AMZN Operating Revenue (Quarterly YoY Growth) data by YCharts; YoY = year over year.

Although its operating profit growth isn't as rapid as it once was, it's still delivering a healthy amount of growth. But is that enough to propel it to the top spot by 2030?

Amazon will have a tough time catching Nvidia

It's unlikely that Amazon will see a rapid growth catalyst over the next five years different from what's currently happening, so the high-single-digit revenue growth and 20% or so increase in operating profit are reasonable expectations for investors.

And the stock is valued around the same level as Microsoft and Nvidia, so it doesn't have an argument for seeing its price-to-forward-earnings multiple increase over the next few years, either.

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts; PE = price to earnings.

As a result, I don't think Amazon's 20% or so operating profit growth will enable it to surpass Nvidia, which is rising at a significantly faster rate. However, it could allow Amazon to catch Microsoft, which is growing by the low double digits.

Regardless, I believe Amazon is an excellent investment, and it will likely deliver market-beating returns over the next five years, driven by its solid profit growth.