A recession, simply explained, is when the economy gets smaller. And because there's less economic activity, recessions can be hard time periods for businesses. To know how well a company can perform during a recession, I like to look at past recessions for clues -- specifically the Great Recession of 2008 and 2009.

Two companies that had strong results during the Great Recession are rural lifestyle company Tractor Supply Company (TSCO 2.20%) and vehicle-auction platform Copart (CPRT -0.60%). As the chart below shows, Tractor Supply's revenue didn't dip at all in 2009. And Copart's was down a measly 7% -- quite resilient.

Chart showing Copart's revenue dipping in 2010 and rebounding, and Tractor Supply's staying steady since 2006.

CPRT Revenue (TTM) data by YCharts

Here's why I love these two stocks and why they can be more recession-proof than other businesses.

1. Tractor Supply

In 2009, the worst year of the Great Recession, Tractor Supply's net sales increased by almost 7%. To be fair, the company's net-sales increase was the result of opening new stores -- it opened 76 that year. By contrast, same-store sales (a measurement of sales at existing locations) fell 1.1%. But that's actually still quite resilient during an economic downturn.

In my opinion, there's a simple explanation for Tractor Supply's resiliency. In 2009, 39% of net sales were in the livestock-and-pet category -- an expense animal owners will pay even during lean times. And this category is only more important for Tractor Supply now. Investors are waiting on the annual filing for 2022, but livestock-and-pet sales accounted for 47% of sales in 2021. 

To put this all into perspective, Tractor Supply's supply chain moved more than 8 billion pounds of animal feed in 2022. To me, that's too much weight for e-commerce companies to want to get involved.

Moreover, on the topic of resiliency, Tractor Supply had over 28 million members in its customer loyalty program at the end of 2022, up 20% year over year. These customers accounted for 75% of the company's sales last year, suggesting its core customer base is a big fan of the brand -- something that can help it remain strong during any potential economic downturn. 

With fiscal discipline, ongoing sales growth, and regular share repurchases, Tractor Supply's earnings per share (EPS) are growing at a rate capable of carrying the stock to market-beating gains. Its regular increases to the dividend are generous as well, as the chart below shows.

Chart showing Tractor Supply's EPS and dividend rising since 2019, and average diluted shares outstanding falling slightly.

TSCO EPS Diluted (TTM) data by YCharts

2. Copart

Copart earns incredible profits. The company's operating margin in the first half of its fiscal 2023 was almost 37% -- extremely high. However, despite plenty of cash, management has never paid a dividend in its nearly 30 years as a public company, and it hasn't repurchased any shares since 2019. This is because it believes it can put its cash to better use.

During its fiscal 2022, which ended in July 2022, Copart acquired around 1,200 new acres of land for storing vehicles for its auctions. According to management, the company owns more than 90% of its 16,000 acres, allowing it to execute its plans without taking a third-party landlord into consideration.

Adding new vehicle yards and expanding existing ones helps Copart increase its competitive advantage in the resilient vehicle-auction space. The company's primary customers are insurance companies looking to get rid of loads of damaged vehicles at maximum prices. By having more than 200 locations, and still growing, Copart can handle their heavy volumes. And it has a large base of buyers, pushing bids higher to the satisfaction of insurance companies.

Vehicles can be damaged in accidents or during natural disasters, and these unfortunate events don't take time off during recessions. This isn't to say that Copart's financial results are completely unaffected by macro-economic conditions -- results right now are being affected by abnormally high used car prices. However, this industry always has demand, and Copart is one of the biggest players in the space.

A sensible choice

I don't know when a recession will strike next. But they're regular economic occurrences. That's why having some more recession-proof stocks like Tractor Supply and Copart in your portfolio could make a lot of sense.

However, if I had to pick just one to buy today, I'd choose Tractor Supply over Copart. Trading at around 30 times its earnings, Copart trades at a more expensive valuation than its 10-year average, as the chart below shows. By contrast, Tractor Supply trades in line with its average.

Chart showing Tractor Supply's PE ratio lower than Copart's since 2018.

TSCO PE Ratio data by YCharts

This suggests that Copart might be a little overvalued right now, and I don't think I'm alone in that belief. Copart's management seems to agree. Consider that management is authorized to repurchase over 81 million shares whenever it sees fit. But it hasn't done so in over three years. 

Therefore, for the more value-conscious investor, I'd wait with Copart's management on the sidelines for a better price, whereas Tractor Supply stock appears to already be trading at a fair price today.