Even after automotive aftermarket-parts retailers posted impressive financial results starting in the middle of 2020, investors seemed to be sleeping on them. While the overall industry has performed extremely well recently, best-in-class O'Reilly Automotive (NASDAQ:ORLY) looks well positioned to produce fantastic shareholder returns. 

You would think that two record-breaking quarters (the second and third quarters of 2020) in the middle of a pandemic would propel the stock to a sky-high valuation, but not O'Reilly. Its stock ended 2020 up just 3.3% on the year. 

Market dislocations like this provide investors the opportunity to purchase stakes in outstanding businesses at attractive prices. Here's why O'Reilly looks like a buy right now.

man holding and looking at item in auto parts store

Image source: Getty Images.

Business update 

As with many companies, the onset of the coronavirus pandemic and ensuing lockdowns in late March of last year put a damper on O'Reilly's business. But once stimulus payments and enhanced unemployment benefits started hitting Americans' bank accounts, it prospered. 

In the second quarter of 2020 (ended June 30) and the third quarter, comparable-store sales grew by 16.2% and 16.9%, respectively, over the prior-year periods. While the initial surge in demand was from do-it-yourself customers using government aid to fix up their cars, O'Reilly management was pleased to see the do-it-for-me (DIFM) segment pick up as well. The latter was particularly encouraging given that the ultimate DIFM customer is someone who can probably work from home, so the pressure on miles driven was more than offset by consumers' willingness to spend on their automobiles. 

Over the past few years through 2019, O'Reilly has consistently added around 200 stores to its footprint annually. The pandemic's disruption last year only slightly altered this pace. With 153 locations opened in the first nine months of 2020, management believes O'Reilly will end the year with 165 new stores. The fourth quarter just ended, so when financial results are announced, investors might get some color on the new store pipeline for 2021. 

CFO Tom McFall still thinks the company can reach 6,500 stores in the U.S., a sizable increase from the current 5,592 domestic locations. A long runway for growth that's still intact is welcome news for investors. 

Long-term demand drivers 

O'Reilly's business benefits from three key drivers. 

First, and probably most important, is the number of miles driven in the U.S. This has a clear effect on the need for maintenance and repair products, as vehicle wear and tear increases. At approximately three trillion miles per year, this figure goes up roughly 1% per year. As stay-at-home orders were put in place across the country in March and April, the number of miles driven took a nosedive. While it's unclear right now how permanent the work-from-home trend will be, it's very encouraging that the number of miles driven has been trending upward month over month since May 2020. 

Second is the size of the vehicle fleet on the road, which currently is over 270 million. It's easy to assume that because new light-vehicle sales were under pressure in 2020, that O'Reilly is negatively affected. But its core customer owns a vehicle that is outside of the manufacturer's warranty, meaning it's older than six to seven years old. If in any given year there are 15 million or so new cars sold in the U.S., that a drop in the bucket for the total vehicle fleet mentioned earlier. 

And lastly, with better-engineered automobiles today, the average age of the domestic vehicle fleet is slowly approaching 12 years. Consumers' willingness to drive their cars for longer (outside of the manufacturer's warranty), leads to strong demand for O'Reilly. 

What about electric vehicles (EVs)? We're probably decades away from EVs dominating our streets. Electric vehicles are projected to only have 7.6% share of new car sales in 2026, an amount too minuscule to dent automotive aftermarket retailers for some time. 

The valuation is compelling 

Over the past decade, the stock has soared 650%, and investors have the opportunity right now to buy O'Reilly at a price-to-earnings (P/E) ratio of 20, which is cheaper than the S&P 500. 

Due to its status as a recession-resilient business that customers need to keep their cars running, O'Reilly is a great addition to your investment portfolio. The company is stable, boring, and predictable, and the market's nearsightedness regarding demand pressures presents an attractive entry point for the long-term investor.

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.