With all the attention going to tech stocks these days, a company like O'Reilly Automotive (ORLY -1.07%) might fly under the radar. However, not learning more about this business could be a huge mistake. Its shares have soared 224% in the past five years, crushing the broader market.

O'Reilly just reported another quarter of upbeat financial results, helping drive the retail stock to a notable 23% gain just in 2025 (as of July 28). Investors should take the time to look under the hood. Here's what O'Reilly's latest earnings say about the health of its business.

A person checking inventory in a stock room of auto parts store.

Image source: Getty Images.

An incredible streak continues

During the second quarter (ended June 30), O'Reilly saw its revenue rise 5.9% year over year to $4.5 billion. This was "driven by solid growth in both professional and "DIY," according to CEO Brad Beckham.

In 2024, O'Reilly reported its 32nd straight year registering positive same-store sales (SSS). In the first quarter of this year, SSS were up 3.6%, before growing again in Q2 by 4.1%.

The monster streak continues. Any retailer should be envious of this track record, which highlights just how successful O'Reilly has been over a very long period, through various economic scenarios. Executives upgraded guidance, as they now believe SSS will climb 3% to 4.5% for the full year.

It's easy to believe these gains will continue for the foreseeable future. O'Reilly benefits from a powerful and durable industry tailwind. The average age of passenger vehicles in the U.S. is now 12.8 years, according to data from S&P Global. This marked the eighth straight year of an increase, a trend that requires more maintenance spending on older vehicles, supporting demand for O'Reilly.

With quarterly results like this, which do nothing but drive positive sentiment from investors, it's strikingly clear that O'Reilly's business is on extremely strong footing. That's a wonderful sign for shareholders.

Management's capital allocation policy

The company's bottom line performed better than the top line. During the quarter, diluted earnings per share increased by 11% year over year to $0.78. This is a very profitable enterprise, with a gross margin of 51.4% and an operating margin of 20.2% in Q2. And it generated free cash flow of $449 million in the period. This allows management to operate from a position of power.

O'Reilly's key growth strategy involves opening new stores to further expand its physical footprint. It ended the second quarter with 6,483 locations, with a small presence in Canada and Mexico. The goal is to end 2025 having opened 200 to 210 net new stores in 2025. Investments are also made to bolster distribution and supply chain capabilities.

Besides that, executives have done a remarkable job returning capital to shareholders. To be clear, this business doesn't pay a dividend. However, it has long utilized consistent share repurchases as a cornerstone of its capital allocation policy. From the start of the buyback program in 2011 to the end of 2024, the business reduced its diluted share count by an unbelievable 57%.

Is O'Reilly's too expensive?

O'Reilly's stock has performed so well in recent years because the company continues to report impressive financial results. The most recent data told the same story, indicating a healthy business in the face of ongoing economic uncertainty. This is a high-quality enterprise.

While the stock should be on your radar, the valuation looks stretched. Shares can be bought at a price-to-earnings (P/E) ratio of 34.8. That's a 35% premium to industry peer AutoZone. And it means that O'Reilly is basically trading at its most expensive P/E multiple this century. Yes, this is an outstanding company, but I believe investors should consider waiting for a pullback before buying shares.