The stock market is not off to a hot start this year: The S&P 500 declined by 7% through the first four weeks of 2022.

In many ways, the U.S. economy bounced back from the pandemic more quickly than expected, but this has led to a combination of high demand for goods and commodities, supply chain troubles, and a low unemployment environment, all of which are feeding into stronger inflation than the country has seen in a few decades.

As a result, the Federal Reserve is bringing its period of ultra-accommodative, loose-money policy to an end. The central bank plans to begin raising the benchmark fed funds interest rate from its current rock-bottom level starting in March, and will begin gradually reducing the amount of bonds on its balance sheet. All of this is putting some downward pressure on stock prices. 

We're not in a bear market -- yet. By definition, that requires stocks to fall at least 20% from a recent high, which has not happened. But the trend has been downward recently. As such, investors may want to look for the types of safe investments that can thrive even in corrections. And if the market plunges even further at some point in 2022, you'll be smart to add O'Reilly Automotive (ORLY 0.57%) to your portfolio.

looking for car parts

Image source: Getty Images.

All-weather appeal 

Bear markets don't always mean there's a recession, but investors shouldn't rule out the possibility of the two happening simultaneously. In this kind of scenario, it's good to be invested in businesses with limited downsides that can continue growing regardless. O'Reilly, a top auto parts retailer, fits the bill. The company sells products like batteries, brakes, motor oil, wiper blades, and a vast array of other replacement parts to both DIY customers and professional mechanics. 

No matter what the economy is doing, people still need functioning automobiles. But in a recession, people are more apt to hold off on buying new cars and instead try to extend the life of their old ones, boosting demand for O'Reilly's wares. On the other hand, in robust economic environments, consumers drive more, increasing the wear and tear on their vehicles. This situation also supports O'Reilly's business. 

During the Great Recession, O'Reilly's sales grew 41.8% in 2008 and 35.5% in 2009. And from 2014 through 2019, the company's annualized revenue growth averaged 7%. In 2020, its sales increased 14.3%, and when 2021's fourth-quarter results come on, analysts expect to hear that last year, revenue jumped 12.5%. Taken together, those statistics demonstrate the resiliency of its business model. 

Strong financials 

O'Reilly Automotive is my favorite auto stock not only because it's recession-proof, but also because of its impressive financials. According to management, the company's gross margin in 2021 (factoring in forecasted Q4 results that are yet to be released) will be between 52.2% and 52.7%. That's higher than top consumer brands like Apple, Lululemon, and Peloton. 

And earnings per share are projected to skyrocket by 24.7% in 2021, continuing a long string of double-digit percentage gains. In fact, in nine of the 12 years from 2009 through 2020, O'Reilly's earnings per share grew in excess of 20%. 

Although the company continues to expand its footprint -- now with 5,718 locations in the U.S. -- by roughly 200 new stores per year, O'Reilly is a cash machine. During the first nine months of 2021, it generated $2.2 billion in free cash flow on sales of just over $10 billion. This has afforded the leadership team the ability to return massive amounts of capital to shareholders in the form of stock buybacks. Since 2010, O'Reilly has cut its outstanding share count in half.

There are still some potential risks present. For starters, O'Reilly has to always look over its shoulder at the threat of Amazon. But the e-commerce giant has been selling auto parts since 2006, showing that O'Reilly has still been able to flourish. Also, as electric vehicles grow as a proportion of annual vehicle sales, O'Reilly's business could become obsolete, as these advanced automobiles are complex, have less moving parts, and will probably require consumers to get them serviced by the original manufacturer. I think it's at least a decade until O'Reilly is adversely affected by this, alleviating any investor concerns for the time being.

Current valuation 

As of Friday, O'Reilly's stock traded at a price-to-earnings ratio of just 22, cheaper than the S&P 500's 26. Rival AutoZone is valued at a price-to-earnings ratio of 19, but O'Reilly has generally shown faster revenue and net income growth. Additionally, O'Reilly has a bigger presence with auto repair shops, an important customer base that greatly benefits its profitability. Therefore, it's not difficult to see why O'Reilly should be valued at a slight premium to its largest competitor. 

However, in a bear market, investors might be able to scoop up O'Reilly shares at a steep discount to its current valuation. That scenario would make buying this industrial stock, which has soared by 50% over the past 12 months, a no-brainer decision.