O'Reilly Automotive (NASDAQ:ORLY) has historically been a great business to own. The stock is up 694% over the past decade, which could come as a shock to investors who might only expect this type of return from a technology stock. 

But despite the long-term track record, this automotive aftermarket parts retailer is currently only trading at a trailing P/E ratio of 20, which is quite attractive given the level of the overall market. 

With more people working from home due to the coronavirus pandemic, O'Reilly's stock has been under pressure as investors ponder just how permanent this shift in behavior will be. Less commuting to the office means less driving, which ultimately translates to less demand for O'Reilly's products. 

These investor fears, while warranted, will prove to be short-lived in my opinion. So, here are three great reasons to buy the stock now.

A stock trader holds his head in frustration, surrounded by stock charts.

Image source: Getty Images.

1. The business is recession-resilient 

During the financial crisis more than a decade ago, O'Reilly kept growing sales each and every year, showcasing that the business is positioned to thrive not only in good economic times, but in bad ones as well. 

In a robust economic environment, consumers drive more and increase the wear and tear on their automobiles, lifting spend on maintenance parts. During recessions when consumer spending is under pressure, people will maximize the use of their existing cars instead of buying new ones, again increasing demand for O'Reilly's products. 

Sales in the first nine months of 2020 were 14.5% higher than in the same period in the prior year, despite an economic shock due to the coronavirus pandemic. While management credits the positive impact of government stimulus on its business, it is very pleased by the continued strength in both the do-it-yourself (DIY) and do-it-for-me (DIFM) segments. 

The last two quarters set company records for comparable store sales and profitability, and while this is certainly not sustainable, it demonstrates just how resilient O'Reilly is regardless of the economic climate.

2. There is still room to grow 

According to O'Reilly management, the automotive aftermarket is highly fragmented, with the top three chains owning less than half of the total stores in the U.S. This presents O'Reilly the opportunity to grow by stealing market share from independent retailers that lack the scale and brand recognition to compete. Management believes that customers care less about price and more about getting the right part as quickly as possible to fix their cars and get on with their lives. Smaller shops just don't have the inventory and supply chain capabilities. 

Like other major players in different industries, the pandemic provided a chance to strengthen competitive positioning as weaker peers struggle to survive. O'Reilly is no different. The company is still opening stores (165 planned for 2020), and management has plans to eventually operate 6,500 stores in the U.S. That means there is a runway for approximately 900 more locations. 

While investors worry about how long the company's key demand driver (miles driven) will remain under pressure, O'Reilly will continue on with its growth plans. 

3. The stock is cheap 

Over the past 12 months, the S&P 500 is up 16%, more than twice O'Reilly's performance during the same time period. I believe this is due to those investor fears mentioned earlier. But given the company's long history of revenue and profit growth, coupled with its recession-proof business model, the stock is undervalued today. 

Further boosting per-share returns is a consistent share-buyback program, one that has led to a near halving of the total shares outstanding over the last decade. Although this program was put on pause as the coronavirus pandemic started, it has since resumed and management will continue utilizing this method of returning excess cash to shareholders. 

O'Reilly hasn't kept up with the stock market's recent rally, but now is the time to get in on this boring, and lucrative, company.

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.