From the start of the financial crisis in 2008 to its end in late 2009, shares of blue-chip retail giant Walmart (WMT 0.09%) rallied by more than 12%. That's striking, considering that nearly every single stock sold off in one of the greatest bear markets of our time. Over the same period, the S&P 500 declined by almost 25%. 

Fortunately, Walmart investors are once again well-protected from the market volatility of our ongoing recession. Year to date, Walmart shares have appreciated by 10%, while the S&P 500 is roughly where it was at the start of the year. What's behind Walmart's incredible share rally this time? Let's find out together. 

Rows of blue shopping carts outside of a store.

Image Source: Getty Images.

What happened back then

During the height of the 2008-09 Great Recession, approximately one in 10 Americans were unemployed. As a result, many people switched to cheaper options for groceries, such as Walmart. 

Indeed, the company's net sales increased by 8.6% year over year to $374 billion in 2008, and again by 7.2% year over year in 2009 to $401 billion. During the two years of recession, the company improved its profitability by $700 million per year. Additionally, Walmart never had a return on equity of less than 20% during the same period. 

While many businesses closed in the fallout from the subprime mortgage crisis, Walmart expanded its core business. The company opened more than 150 superstores in the U.S. in 2009, and nearly 500 units outside the U.S.

That the company is witnessing the same phenomena as before should be no surprise. 

How Walmart is thriving now

As of June, the U.S. unemployment rate reached 12% due to the COVID-19 pandemic. At the same time, demand for groceries and consumer staples has gone up significantly. Many Americans are looking for affordable household items, or are outright panic-buying in fear of supply chain shortages. 

Either way, Walmart's business and bottom line are booming due to its classification as an essential service. During the first quarter of its fiscal year ending May 1, Walmart's net sales and net income grew year over year by 8.7% and 3.9%, respectively, to $134 billion and $4 billion. Revenue growth of 10% in the U.S. was the main driver of these results.

Overall, the company's comparable-store sales increased by a staggering 9.7%. That's impressive for any large-cap retail company. Meanwhile, Walmart created more than 235,000 new jobs for those who were laid off due to the pandemic and set up 139 COVID-19 testing sites in its parking lots. The company also improved its online and contact-free shopping capabilities, responding to a 74% revenue increase in its e-commerce segment compared with last year. 

Currently, Walmart's financial health is superb, with a modest debt-to-capitalization ratio of 46%. Although the stock is trading at 25 times earnings, the company has a track record of resilience during difficult times. I fully expect Walmart's sales to continue growing in the face of disruptions caused by COVID-19 -- all the more reason why retail investors should add Walmart to their core holdings