The last time two public companies in the U.S. hit a $1 trillion market cap at the same time, it was early September 2018, when the tech-lead U.S. stock market was near all-time highs.

Now, after much of the group plummeted into correction territory late last year, Microsoft (MSFT) - Get Report and Apple (AAPL) - Get Report  once again sport $1 trillion market caps (Apple dipped slightly below the mark in afternoon trading), with Amazon (AMZN) - Get Report not far behind at roughly $935 billion. 

Apple's market cap hovered right around $1 trillion Wednesday after beating earnings expectations for its June quarter; its stock is up 38% year-to-date. Microsoft's market cap has exceeded $1 trillion for some time, and its stock is up 37% in 2019. And Amazon, despite stumbling a bit after reporting lower-than-expected profits last week, is up 23% year to date. 

For much of the current U.S. bull run -- the longest in American history -- growth stocks like Microsoft and the FAANG group have outperformed value stocks, with low rates having been a big boon to growth stocks, LPL Financial chief investment strategist John Lynch wrote in a recent note. 

Image placeholder title

Most specifically, here's what has driven the gains in Apple, Amazon and Microsoft:

Apple

As smartphone demand has waned and the iPhone has lost market share in China, Apple has still seen big gains, largely due to its burgeoning services business. Apple's latest quarterly report out Tuesday showed the iPhone accounted for 48% of revenue, the first time in years that it didn't account for more than half of the company's revenues. 

Plus, services are a higher margin business than the hardware side of the business, as many analysts use a higher multiple on the services part of their sum-of-the-parts valuations for Apple. "We believe the services business is worth roughly $400 billion to $450 billion, making the current valuation of Apple's stock today look compelling on a risk/reward basis," Wedbush Securities analyst Dan Ives wrote in a note. 

TST Recommends

In Apple's June quarter, management not only boasted an earnings and revenue beat, but it raised guidance for the September quarter. That drove the stock up more than 5% at one point to $218 a share, putting it over the $1 trillion threshold.

Amazon, Microsoft and the Cloud

Recent re-evaluations of their already promising cloud businesses have powered much of Microsoft and Amazon's gains, according to analysts. 

"Partially, I think there's been a re-rating going on for the cloud business and that's really causing an uplift to both stocks," Ives told TheStreet recently. He noted that roughly 30% of enterprise workloads have adopted the cloud, but when that moves up to 50%, "there's going to be three times the amount of spend" than there is now, Ives said. 

In April, Microsoft said Azure revenue grew 73% in its March quarter, helping lift the software giant's market cap above $1 trillion for the first time ever. Even as Azure growth decelerates (64% in the June quarter), the platform, along with Microsoft's on-premise server business, can collectively deliver "upper teens constant currency growth in coming years," Stifel analyst Brad Reback wrote in a recent note. 

Ives noted that "it's clear among enterprises that there's a massive shift to cloud, which really looks pronounced going into the second half [of 2019. That's something you've seen in just the number of companies that have been reporting earnings." Ives also said his channel checks show an acceleration in cloud spending for the second half. He said Financial firms in particular are big cloud spenders.

As for Amazon, earnings-before-interest-and-tax attributable to its Amazon Web Services business is expected to grow 37% year-over-year for all of 2019, according to FactSet. That profit growth is expected to be 33% in 2020. Plus, the operating margin for AWS is higher than it is for other Amazon segments, and AWS is expected to contribute 51% of total EBITDA in 2020, up from 47% in 2019.

These expectations may have pushed these stocks higher, but they could still have more room left to go. Ives has a $160 price target on Microsoft, representing 15% upside, while Reback maintains a $150 price target. Meanwhile, the average analyst price target for Amazon is $2,280, 20% higher than its current price.

Save 76% with our Summer Break Sale. Subscribe to our premium site Real Money and become a smarter investor! Click here today to sign up!

Microsoft, Amazon and Apple are holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells these? Learn more now.