For most of the past five years, Apple has been the world's most valuable company, with oil giant ExxonMobil a close second and other companies far behind. But recently, Apple's earnings growth has slowed, while Alphabet — the company most of us know as Google — has seen its profits continue to grow. The result: Alphabet briefly passed Apple on Thursday to become the world's most valuable company — though it ended the day worth $488.7 billion, slightly less than Apple's $489.9 billion.

The remarkable thing about this is that Apple's 2015 operating income (that's profits, basically) of $71 billion was more than three times Google's operating income of $20 billion. So you might expect Apple's market value would be a lot higher than Google's. The fact that Wall Street is valuing them about the same is a signal that the market is a lot more optimistic about Google's growth prospects. Investors expect Google's profits to continue going up, whereas Wall Street thinks Apple's massive iPhone profits have nowhere to go but down.

Google makes most of its money from ads

Google does a lot of different things. It has a browser called Chrome, a smartphone OS called Android, and a wide variety of online services such as Google Maps, Gmail, and Google Docs. Google's parent company, Alphabet, is working on self-driving cars, residential broadband networks in several cities, and a lot more.

But Google's revenues overwhelmingly come from one thing: advertising.

In 2015, ads accounted for about 90 percent of Google's overall revenues, and of this ad revenue three-quarters came from ads on Google's own websites — including a large share for Google's market-leading search engine. The remaining quarter came from Google's ad networks, which sell ads that appear on other people's websites.

Ads account for about 90 percent of Google's revenues

Some high-profile Google products aren't directly ad-supported, but most of them indirectly support Google's ads business — and especially its flagship search engine. For example, creating Android and giving it away to smartphone companies helps ensure that Google's search engine and other online services remain popular with mobile users. Similarly, owning the leading web browser, Chrome, helps Google steer users toward its search engine.

This is worth a lot of money: Google paid Apple $1 billion in 2014 to ensure that Google was the default search engine on iPhones. And until 2014, Google paid hundreds of millions of dollars every year to ensure Google is the default search engine for the Firefox web browser (more recently, Yahoo has outbid Google to be the default).

The ad business keeps getting more lucrative for Google:

Apple makes most of its money from the iPhone

While Google makes most of its money from ads, Apple makes most of its money from selling iPhones. The iPhone is a lot more lucrative than any of Apple's other products. Apple sold 231 million iPhones in 2015, generating $154 billion in revenue. In its most recent quarter, Apple generated almost twice as much revenue from the iPhone as all of its other products — iPads, Macs, Apple Watches, and so forth — put together.

Like Google, Apple has seen its revenue soar over the past few years as the iPhone has gotten more popular. But unlike Google, it looks like Apple is seeing a slowdown in its previously rapid growth. In April, Apple reported its first down quarter in over a decade, with revenues falling 13 percent from a year earlier.

The issue seems to be that the iPhone is close to saturating its market. Apple dominates the market for high-end smartphones so completely that most of the people around the world who can afford to buy an iPhone already have one. Apple will be able to continue selling tens of millions of iPhones every quarter as their existing users upgrade, of course. But there doesn't seem to be much room for further growth in iPhone sales.

To continue growing, then, Apple needs to come up with another massive hit. And it hasn't been able to do that. The iPad is pretty popular, but it's nowhere near as popular as the iPhone, and its sales are actually declining. The Apple Watch seems to be a pretty successful product by conventional measures, but, again, it's nothing like the iPhone.

Wall Street is more optimistic about Google's growth than Apple's

Of course, Apple could always surprise us. The company has a talented staff and tens of billions of dollars to invest in new products.

But Apple's stock price suggests that Wall Street, at least, isn't optimistic about Apple's chances of coming up with anything new that will match the iPhone's success. A key statistic to watch here is the price-to-earnings ratio — that is, the company's stock price divided by its annual profits.

If the P/E ratio is high, that means Wall Street is paying a premium in hopes that profits will rise over time. A low P/E ratio signals that Wall Street expects profits to stagnate or even decline in the future.

Fast-growing technology companies have share prices that are 20, 50, or even 100 times their earnings. Alphabet's P/E ratio, for example, is about 30.

In contrast, Apple's P/E ratio is about 10. That means Wall Street is valuing Apple like a sleepy utility company — still highly profitable, but with little prospect for future growth.

Apple's charismatic founder is dead, while Google's are still around

There are lots of technology companies that have one big hit and then stop growing once that initial product matures. Yahoo, Twitter, and eBay are all examples of companies that seem to have hit a wall.

What makes Apple and Google remarkable is that they were able to follow up an initial hit — early PCs in Apple's case, a search engine in Google's — with many other successful products. Apple had the iPod, iPad, and iPhone. Google has had Gmail, Google Maps, Android, Chrome, and so forth.

It's impossible to say exactly why some companies continue to thrive while others turn out to be one-hit wonders, but one common theme seems to be that the most successful companies still have their charismatic founders at the helm. Apple struggled during Steve Jobs's absence between 1985 and 1997, then enjoyed an amazing resurgence between 1997 and Jobs's death in 2011. Google has been under the control of its founders, Larry Page and Sergey Brin, since the beginning.

Founders have an unmatched level of respect among rank-and-file employees. Because they've been at the company since the beginning, founders have relationships with people all across the country.

This is particularly important when a company needs to make a big change. Employees at once-great but now-struggling companies have a tendency to romanticize a company's early days and resist necessary changes. In these moments, no one has more credibility than a company's founders to put these concerns into perspective and make the case that the company needs to change if it wants to survive.

Founders' greater credibility also allows them more leeway to take big risks. Ordinary CEOs serve at the pleasure of the board, so they constantly have to worry that they'll lose their jobs if they go too far out on a limb. Founders tend to be more secure in their jobs, which makes them more able to take big risks and push through necessary changes.

Apple, of course, lost its visionary founder to cancer in 2011. It's now run by Tim Cook, a man who is by all accounts an able manager but doesn't seem to have Jobs's vision. Prior to Jobs's death, Cook's focus was on optimizing Apple's operations, not creating new products. Alphabet, on the other hand, is still run by co-founders Larry Page and Sergey Brin. They've made big bets on everything from Android to self-driving cars. Some of those bets have failed, but others have been big hits.

That might be one reason Wall Street is bullish on Alphabet but bearish on Apple. The iPhone is a great product, but there's little reason to think Cook will be able to create more products like it. On the other hand, the market seems to be hoping that Page and Brin are just getting started.

Disclosure: My brother is an executive at Google.

Correction: I stated that Google pays Firefox to be the default search engine, but Firefox switched to Yahoo in 2014.