Amazon CEO Jeff Bezos with Google cofounder Sergey Brin. Reuters On Thursday, three of the biggest and most important companies in tech reported earnings: Google (now called Alphabet), Microsoft, and Amazon.

All of them beat expectations. Crushed them, actually. And all of their stock prices rose pretty dramatically. Each was up more than 10% after hours, and the final tally at the end of trading the next day was Google/Alphabet +7.7%, Amazon +6.23, and Microsoft up a whopping 10.08%.

Not coincidentally, these three companies are also the leaders in cloud computing, which has been been a buzzword for about 15 years but has really taken off in the last five.

Amazon and Microsoft in particular owe their results in large part to the success of their cloud businesses.

Perfect timing for the cloud

The reason is simple. A couple decades ago, every company had its own computers running in a data center which it owned or leased. These computers ran their web sites, internal operations, whatever.

With cloud computing, companies outsource a lot of these functions to a company that specializes in tech. Instead of worrying about racks of hardware and whether those computers have the latest software updates and security patches and proper cooling, cloud computing lets businesses focus more on the technology that actually helps improve their business.

Think about how tech has become so common in our personal lives that it's like oxygen. We don't even really think about our phones anymore. We just use them.

The same thing has slowly been happening in businesses. That's the cloud.

Amazon, Google, and Microsoft were all just far enough ahead of the curve to take advantage of this move. Now, they're reaping the benefits.

Too hot, too cold, or just right?

But this business model is juuuust right. shogunrummel via YouTube

The success of these three companies on Thursday goes against the strain of worry in Silicon Valley and a lot of the tech sector right now. Investors are warning that a lot of startups are overvalued, while simultaneously circling their wagons against criticism.

Layoffs are suddenly a lot more common (including at Microsoft, which quietly laid off around 1,000 people as it reported earnings).

What's going on here? Think of it like Goldilocks and the three bears.

On one side, you've got a bunch of young companies that got too hot, including some of the so-called unicorns with private valuations over $1 billion. They raised too much money, too fast, based on user growth, without figuring out how they were going to turn those users into profitable customers.

It's not that hard to show fast user growth if you're subsidizing every new user; that's like selling dollars for 75 cents.

As VC Fred Wilson wrote this week, companies with negative gross margins will dry up and blow away when they can no longer raise new funds. He's particularly skeptical about "on demand" services, like food delivery, and certain companies that provide services to other startups but aren't passing the true costs of those services.

On the other side, a bunch of old companies got too cold. They were so busy protecting their existing cash cows, and they were too slow to embrace the technologies that threatened to kill them. In this bucket, you could put HP, which just shut down its cloud business, and Oracle, which is struggling with its cloud platform so badly that it's building a new cloud platform right alongside its old one.

Meg Whitman, who's overseeing HP's split into two companies. AP Photo/Richard Drew

In the middle, you have the companies that are doing it just right.

Amazon has been plugging all its profits into new businesses since its inception. It finally stumbled across a new business — the cloud — that might someday be bigger than its original retail business.

Google has taken the immense profits from its search advertising business and gradually expanded to the point where it has six products used by over 1 billion people.

Microsoft was left for dead a few years ago. However, it has managed to turn its relatively early embrace of the cloud — the company rolled out predecessors to its current cloud services back in 2009 and 2010 — into a business that's growing fast enough to make up for the slow declines in its legacy PC business.

Other companies that are getting it just right include Apple, which performed a similar pivot from its personal computer business (the Mac) to mobile devices long before it was obvious that they'd take over the world, and Facebook, which embraced a mobile focus right after going public in 2012.

Many of these companies also have massive balance sheets. Google has more than $70 billion in cash sitting around. Microsoft has just shy of $100 billion.

As the "too hot" companies implode, and the "too cold" companies consolidate and merge to eke out more profits from their shrinking core businesses, the "just right" companies will be well positioned to pick up the pieces.