With just a few sessions left in the year, it looks almost certain that Amazon (NASDAQ:AMZN) won't beat the S&P 500 this year. While the e-commerce giant is still up 19% year-to-date, the broad-market index has jumped 28%. Assuming that pattern holds, it would be the first time since 2014 that Amazon has underperformed the S&P 500.

While investors in the tech titan may be disappointed with the modest growth this year, Amazon could be primed for a more explosive surge next year. Here's why.

A Prime Air jet in a hangar

Image source: Amazon.

1. Recent investments will bear fruit

Amazon's profits surged through 2018 thanks to massive growth in its advertising business and expanding margins from its third-party marketplace, but earlier this year profits started to shrink again. That's largely due to investments in its fulfillment operations to make one-day Prime delivery standard; the company is also in the middle of a heavy investment cycle in Amazon Web Services.  

In its third-quarter earnings report, CFO Brian Olsavsky noted that AWS operating margin had peaked in the third quarter the year before at 31% as it reaped earlier investments. He explained the recent spending surge, saying, "We are investing a lot more this year in sales force and marketing personnel, mainly to handle a wider group of customers, an increasingly wide group of products." AWS operating margin in the latest quarter slipped to 25.1%, its lowest in at least six quarters.

Olsavsky also said that the company spent $800 million on incremental shipping expenses in the second quarter to make one-day delivery possible, and expected to spend $1.5 billion in the fourth quarter for the same reason. That spending is causing profits to fall, but Amazon will lap the one-day delivery launch in the second quarter next year, which should help profits rebound as growth in shipping expenses normalizes. Moreover, Amazon is also raising prices by 3% on Fulfillment by Amazon, its storing-and-shipping service for third-party sellers, which will help make up for the additional spending increases. Likewise, growing its AWS sales force should pay off over the next year.

2. It's turning into a logistics powerhouse

Even if Amazon's profits are falling and the stock performance has been middling, the company continues to expand its economic moat. Its logistics operation may be the biggest way it's accomplishing that right now, and Amazon is now delivering approximately half of its own U.S. orders. 

Over 2019, the company is on track to deliver about 3.5 billion packages globally, not too far behind the 5.2 billion packages and documents that UPS will handle this year. Amazon is its own biggest provider of logistics services, ahead of both UPS and the Postal Service. A recent report from Morgan Stanley estimated that Amazon would be handling 6.5 billion packages by 2022, ahead of both FedEx and UPS, and that 1.5 billion to 3.5 billion of those packages would be from non-Amazon customers, contributing an additional $7 billion in revenue.

UPS and FedEx have operating margins ranging from the high-single digits to low-double digits. Amazon should be able to achieve the same kind of returns with its logistics operation, expanding the profit margin of its own e-commerce business, and the company has said that providing its own deliveries will help lower its own costs. 

As Amazon reveals more data about its logistics operation, investors are likely to reward it. The stock surged when the company first broke out AWS results -- shedding light on its delivery business could have a similar effect.

3. The growth ceiling has gotten higher

Tech stocks dominated the last decade, especially the FANG group, which includes Amazon. However, in 2019, Apple and Microsoft were the standout tech giants, gaining 80% and 55%, respectively. The two companies are now valued at more than $1.2 trillion each.

Amazon, by comparison, may look richly valued at a market cap of $889 billion, but the company has lost ground against its peers like Apple and Microsoft, which have captured the hearts of tech investors over the last year. Amazon was twice the world's most valuable public company earlier this year, but is now down more than 10% from its all-time high. Still, it could easily regain the title of world's most valuable public U.S. company.

Analysts are still bullish on Amazon, and the rise of Apple and Microsoft makes it clear that the broad market is still betting on big tech. If Amazon's profits return to growth, there should be plenty of room for the stock to surge, as tech investors have shown they're comfortable with valuations well north of $1 trillion if the fundamentals warrant it.

What's next

Amazon issued characteristically conservative guidance for the fourth quarter, calling for revenue growth of 11%-20% and declining operating income. The decline in profits is due largely to the $1.5 billion in incremental one-day delivery spending, but Amazon could easily top those numbers, especially as the response to one-day delivery has been overwhelmingly positive. Keep an eye out when the company reports fourth-quarter earnings at the end of January, as a better-than-expected report could spark a jump start to a strong 2020.

The last time Amazon underperformed the S&P 500 in 2014 with a 22% loss, it bounced back in 2015, climbing 118%.