Fortune released its annual Fortune 500 rankings this week, listing the largest companies by revenue generated last year. Amazon.com (AMZN -2.56%) was able to pull off a major coup: The e-commerce behemoth has leapfrogged Apple (AAPL -1.22%) to become the No. 2 company behind Walmart (WMT 0.46%), which ranked No. 1 for the eighth consecutive year.

Here's how the distinguished list changed for 2020.

Amazon delivery driver leaning out the window of an Amazon van, holding out smartphone to fellow Amazon employee

Amazon generated approximately $20 billion more revenue than Apple last year. Image source: Amazon.

Amazon won't overtake Walmart anytime soon

As the biggest retailer on Earth, Walmart's revenue of $524 billion remains comfortably ahead of any other company. Amazon's top line grew by 21% in 2019 to reach $281 billion, climbing the highest it's ever been in the rankings. Keep in mind that the list is based on 2019 revenue -- i.e., before the COVID-19 pandemic spread worldwide. The coronavirus outbreak has accelerated the shift to e-commerce as people shop from the safety of their homes, and Amazon has seen a spike in demand as a result.

Meanwhile, Apple's revenue has seemingly plateaued as iPhone sales slow and the company looks to other segments like services and wearables to pick up the slack. But considering the sheer size of the iPhone business, it takes a lot to compensate for iPhone declines. The Cupertino tech giant's revenue fell a modest 2% last year to $260 billion, with its ranking slipping to No. 4.

Here's how the top five companies have changed over the past several years.

Rank

2018

2019

2020

1

Walmart

Walmart

Walmart

2

ExxonMobil

ExxonMobil

Amazon

3

Berkshire Hathaway

Apple

ExxonMobil

4

Apple

Berkshire Hathaway

Apple

5

UnitedHealth

Amazon

CVS Health

Data source: Fortune.

Microsoft (MSFT -1.27%) was all the way down at No. 21 with $126 billion, even as the enterprise software juggernaut boasts the highest market cap ($1.4 trillion) because investors are pricing in higher growth expectations from its booming cloud business. The most valuable companies in the Fortune 500 now fetch a combined market valuation of $4.6 trillion. In terms of market cap, Apple's is just under $1.4 trillion and Amazon is worth a little over $1.2 trillion.

WMT Revenue (Annual) Chart

WMT Revenue (Annual) data by YCharts.

With the annual reshuffling, Apple CEO Tim Cook's preferred (and frustrating) way of disclosing the size of the wearables business is rendered irrelevant. Cook likes to compare the wearables business to the list, even though all the thresholds and rankings change every year. For example, the most recent such comparison was that Apple's wearables business was the size of a Fortune 150 company, translating into $20.8 billion in revenue based on last year's rankings. No. 150 this year is Rite Aid, with $21.7 billion.