Amazon.com (NASDAQ:AMZN) made headlines today by becoming just the second U.S. public company to cross the $1 trillion market cap benchmark. In early August, Apple was in the spotlight, having achieved the same historic feat.

A few other companies were hoping to steal the limelight, but in the end, it was Amazon that achieved the feat ahead of Alphabet and Microsoft. Amazon's performance year to date gave it the edge over its would-be competitors, as the company's gains of 75% so far in 2018 pushed it over the top.

Let's look at what propelled Amazon to these lofty heights and what the future holds for investors.

Numerous people in silhouette having a discussion with stock market tickers in the background.

Image source: Getty Images.

How Amazon got here

A number of catalysts contributed to Amazon's recent rise. The company's second-quarter financial report certainly added fuel to the fire. Amazon reported revenue of $52.9 billion, a 39% increase year over year, while earnings per share of $5.07 soared 1,168% compared to the prior-year quarter -- more than double analysts' consensus estimates.

Continued strength at Amazon Web Services (AWS) -- the company's cloud computing operation -- was a significant factor in the company's gains. In 2017, net sales at AWS grew 43% over the prior year, and grew to 10% of Amazon's total revenue. With operating margins of nearly 25%, it accounted for all of the company's operating income. That trend continued this year. In the first six months of 2018, net sales at AWS increased 49% year over year and accounted for more than 11% of the company's total revenue, while operating margins improved to 26%. Some people think this is just the beginning and believe that AWS could triple over the next five years.

AWS wasn't the only segment to see margin improvement this year. During the first half of 2018, operating margins in the company's North American e-commerce segment more than doubled compared to the prior-year period, and losses at its international markets declined, improving its operating margin from -5.3% to -3.7%.

Recent love from analysts also boosted the stock. Brian Nowak of Morgan Stanley recently upped his price target to $2,500 -- more than 22% above the stock's current level, citing growth in subscriptions, AWS, and other -- including a recent increased focus on advertising. Ashim Mehra of Baron Capital went even further, saying Amazon could achieve a $2 trillion market cap in the coming three to five years, driven by cloud computing and advertising. 

Prime numbers

The results of Amazon's recently completed Prime Day also gave investors a reason to bid the stock higher. In a press release, Amazon said sales from the 36-hour event "surpassed Cyber Monday, Black Friday and the previous Prime Day ... making this once again the biggest shopping event in Amazon history." 

A large tractor trailer truck with the Amazon Prime logo on the trailer on a field of blue.

Image source: Amazon.

Amazon has yet to report quarterly results that include the July sale, but Prime Day helped the company produce a blowout quarter last year, surpassing analysts' consensus estimates and Amazon's own forecast. When asked  to explain the better-than-expected results, CFO Brian Olsavsky said, "I wouldn't point to anything other than the Prime Day pickup, but stronger than -- it was stronger than probably I anticipated."

In his annual shareholder letter earlier this year, Amazon CEO Jeff Bezos revealed that Prime topped 100 million paid members globally, and it has certainly added more members since then. During Prime Day, Amazon said it "welcomed more new Prime members on July 16 than any previous day in Amazon history." Those subscribers are among Amazon's most valuable customers, spending an estimated an average of $1,400 annually compared to $600 for non-member customers, according to research from Consumer Intelligence Research Partners. 

What the future holds

Continued strong growth at AWS, the growing ranks of Prime members, and improving margins across the business not only helped Amazon achieve its recent benchmark, but will likely continue to push the company to even greater heights.

In addition to its cloud, e-commerce, and grocery businesses, the company has growing stakes in smart speakers, advertising, and streaming video. With this many ways to win, $1 trillion may just be the tip of the iceberg for Amazon.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Danny Vena owns shares of Alphabet (A shares), Amazon, and Apple. The Motley Fool owns shares of and recommends Alphabet (A and C shares), Amazon, and Apple. The Motley Fool has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.