History may not always repeat, but the past can serve as a guide. For investors, looking at previous market winners might help us identify stocks that could outperform from here.

In that vein, consider a leading niche retailer that usually flies under the radar. As of this writing, this retailer's stock is up by more than 55,000% since its initial public offering in April 1993. In just the last five years, it's up by 213%.

Yet even after those monster gains, there's one reason why it could still be a smart buy.

IPO abstract finger pointing.

Image source: Getty Images.

A favorable tailwind that drives demand

The modern world is constantly being reshaped by the forces of cutting-edge technology -- cloud computing, AI, digital payments, and e-commerce to name just a few. And those technologies are providing serious tailwinds to many of the businesses connected to them.

O'Reilly Automotive's (ORLY 1.02%) business doesn't fall into any of these high-tech buckets. However, one understated tailwind will continue to benefit this aftermarket auto parts retailer.

A recent report released by S&P Global showed that the average age of vehicles on the road in the U.S. is now 12.8 years. This figure has climbed for eight straight years. While that secular trend may not be as exciting as the others mentioned, it will be a reliable boon for O'Reilly.

It sells various products, including motor oil, air filters, brake pads, floor mats, and batteries, among many other things, to both do-it-yourselfers and professional mechanics. Aftermarket is the key thing investors should remember -- these are products that aren't usually made by the original car manufacturers. Consumers shop at O'Reilly to extend the lives of their vehicles.

More mileage means more upkeep

The greater the mileage is on a car, the more upkeep it will require. Natural wear and tear isn't hard to understand. But most car warranties expire after three to five years, after which whatever goes wrong is strictly the owner's problem. As cars stay on the road for more years and more miles, demand gets stronger for the stuff that O'Reilly sells.

The macroeconomic environment is also helping the retailer. With interest rates on auto loans at some of their highest levels in the past decade and other material and labor costs up as well, buying a car is less affordable. This incentivizes people to spend money on repairing the vehicles they already own.

These trends have shown up in O'Reilly's financial performance. In 2024, the company reported a same-store sales increase of 2.9%. That was its 32nd straight year of growth, which is unheard of for any retailer. This demonstrates the company's ability to thrive regardless of economic conditions.

O'Reilly is a winner, but can the good times continue?

There's a lot to like about this company. Steady demand that propels revenue and earnings higher is undoubtedly one reason that O'Reilly should be on your investing radar. Management has also aggressively used its free cash flow to buy back stock. In the past five years, O'Reilly has reduced its outstanding share count by 24%.

However, the valuation isn't cheap, and that's my main concern. Its current price-to-earnings ratio of 32.8 is 36% higher than its trailing 10-year average, so I'm waiting for this multiple to come down before I even consider adding O'Reilly to my portfolio. But given the company's impressive track record, other investors might have a different view.