If you have shopped for a new vehicle recently, you have probably had a much different experience than in prior years. The days of haggling to a price substantially lower than the manufacturer's suggested retail price (MSRP) are long gone, and consumers are instead paying well over the sticker price in most cases. According to NBC News, 82% of buyers paid more than $700 above the MSRP in January.

With this in mind, many Americans will likely be holding on to their current vehicles longer, and this could significantly benefit retail parts suppliers like AutoZone (AZO -1.96%) and O'Reilly Automotive (ORLY -3.08%)

Why are prices rising?

The inflation rate in the U.S. reached 7.5% in January 2022, the highest it has been in 40 years as measured by the consumer price index (CPI). There are several reasons for this occurrence. One is that COVID-19 has crimped the supply chain, and the recent omicron variant has exacerbated these issues. While the variant appears to be fading fast, the supply chain will take longer to smooth out.

A person uses tools on a car's engine.

Image source: Getty Images.

The automobile industry has been particularly hit by a severe shortage of semiconductor chips that vehicles need to make everything from heated seats to navigation systems work. According to The Alliance for Auto Innovation, the chip shortage could cause over a million fewer vehicles to be produced in the U.S. this year.

The shortage of new cars also has a trickle-down effect on used vehicles. Fewer trade-ins for new cars also decreases the supply of used vehicles, and prices rise in both markets. As shown below, the CPI for new cars and trucks has skyrocketed recently. 

US Consumer Price Index: New Cars and Trucks Chart

US Consumer Price Index: New Cars and Trucks data by YCharts

While automakers work to increase production to meet demand, many consumers will be priced out of the market and need parts for their current vehicles. That is where AutoZone and O'Reilly can make hay.

AutoZone

AutoZone stock has fallen nearly 15% year to date; however, it is up more than 50% over the past year. The company is a retailer of auto replacement parts and accessories. Net sales for fiscal 2021 reached $14.6 billion. This is up 16% over fiscal 2020. Gross profit also rose from $6.8 billion in 2020 to $7.7 billion in 2021. More importantly, its gross margin remained strong at nearly 53% vs. 54% in 2020. This means that the company has successfully passed along the increases in prices to consumers or suppliers and retained its profitability.

Diluted earnings per share (EPS) came in at $95.19 in fiscal 2021, a 32% increase over fiscal 2020. Part of this improvement is attributable to the company's generous share-buyback program. For fiscal 2021, the company repurchased $3.4 billion of its common stock. This is nearly 9% of its current $38 billion market capitalization. The board of directors authorized an additional $1.5 billion in buybacks in December 2021. The program has returned over $29 billion to shareholders since 1998. This amounts to over $1.2 billion in buybacks each year, on average.

Buybacks are a terrific way to support shareholders. By reducing the number of shares available, the company increases each stockholder's piece of the pie -- including the EPS -- which typically will increase the stock price. Unlike dividends, stock repurchases are also not directly taxable to shareholders. 

O'Reilly Automotive

O'Reilly is also a parts supplier that serves both professional service providers and retail consumers. Fiscal-year 2021 sales increased 15% over 2020, reaching $13.3 billion. Same-store sales increased more than 13% in 2021 on top of a nearly 11% increase in 2020. Much like AutoZone, O'Reilly was also able to maintain a gross margin of about 53% for 2021. The operating margin for 2021 was near 22%, up from 21% in 2020, showing that management is effectively managing costs. Cost management is essential given the tightness in the labor market and bottlenecks in the supply chain.

Diluted EPS came in at $31.10 in 2021, an increase of 32%. O'Reilly also repurchases significant amounts of its stock. In 2021, the company spent nearly $2.5 billion on stock repurchases. This amounts to over 5.5% of the current $44 billion market cap. O'Reilly's stock is down more than 10% year to date, but it is up nearly 40% over the past year.

Reasonable valuations

Both companies are currently trading at price-to-earnings (P/E) ratios below their recent peak and below where they were trading Jan. 1, 2020 -- just before the pandemic.

AZO PE Ratio Chart

AZO PE Ratio data by YCharts

With this in mind -- and Americans continuing to experience sticker shock in the new and used car markets -- it may be time for long-term investors to consider these stocks.