Stocks performed well on Friday, and the Nasdaq Composite (NASDAQINDEX:^IXIC) led the way higher. Gains of about 1% as of 11:45 a.m. EDT outpaced other major indexes.

Microsoft (NASDAQ:MSFT) helped to lift the Nasdaq higher on the final trading day of the week, with a rise of 2.4% Friday morning outpacing Apple's (NASDAQ:AAPL) smaller 0.8% gain. That further narrowed the market capitalization gap between the two Nasdaq tech stocks, raising the question of whether the software giant could overtake the iPhone maker to become the Nasdaq-listed company with the highest valuation in the market.

The once and future king?

Many investors might not recall that Microsoft has been atop the market capitalization list in the past. Back in 1998, the tech boom helped lift the Windows maker's market cap to more than $260 billion, helping Microsoft surpass General Electric to take the top spot.

The ensuing tech bust and bear market starting in 2000 led to Microsoft losing its perch for a while. However, by mid-2002, Microsoft was back in the top spot, once again topping GE. It wasn't until 2005 that rising energy prices helped ExxonMobil surpass tech companies, and the oil giant held its spot until Apple finally took over in the early 2010s.

The past few years have seen Microsoft and Apple change places several times. As the graph below shows, Apple has been a more volatile stock, while Microsoft has steadily closed the gap with a lot fewer bumps and dips along the way.

AAPL Market Cap Chart

AAPL Market Cap data by YCharts.

A real cloud advantage

One reason why Microsoft has been able to do so well lately is the extent to which it has embraced the promise of cloud computing. For a long time, the software giant did its best to resist change, fearing the loss of its near-monopoly status in areas like PC operating system software and workplace productivity tools.

Three people in a server farm.

Image source: Getty Images.

When CEO Satya Nadella took over the reins, however, he embraced cloud computing. Suddenly, Microsoft products were available as subscriptions, and that led to a big boost in recurring revenue that better monetized the company's leadership position in key niches.

Going forward, Microsoft appears to be a lot further along in cloud business model adoption than Apple. By its nature, Apple relies heavily on its hardware, with sales of iPhones, Mac computers, iPad tablets, and other devices contributing the lion's share of revenue. Apple's services division has historically brought in less than 20% of total sales for the company, and despite efforts to boost the fortunes of that segment, the iPhone is still responsible for roughly half of the revenue Apple gets.

By contrast, Microsoft has worked hard to grow recurring revenue more quickly. Office 365, the Azure cloud computing platform, and other software-as-a-service offerings have produced exceptional growth opportunities. For more than 20 years, industry watchers have known that software is a more reliable source of revenue than hardware, and even though Apple has thus far bucked the trend, many still fear that Apple's ability to innovate might wane in a manner that will give Microsoft the upper hand.

Keep your eyes on the Nasdaq prize

Right now, about $150 billion separates Apple from Microsoft. All it would take is a 6% to 7% relative move to send Microsoft into the top spot once again. Both companies look solid, but it'll be interesting to see whether Microsoft's advantages can give it the edge for the rest of 2021 and beyond.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.