While the Nasdaq-100 index is more famous for its technology-focused companies, it is also home to a handful of successful consumer discretionary stocks.

One of these is car-parts specialist O'Reilly Automotive (ORLY -0.97%) and its 6,000-plus stores. Although one could argue that O'Reilly's operations are about as different from the high-flying tech world as possible, its seven-fold increase in price means investors should ignore this efficient operator at their own peril. 

Home to budding international sales, best-in-class profitability, and extremely shareholder-friendly share buybacks, O'Reilly is a magnificent Nasdaq stock to buy and hold forever.

O'Reilly Automotive's growth story

Operating in an oligopoly alongside AutoZone and Advance Auto Parts, O'Reilly generates roughly 56% of its sales from do-it-yourself (DIY) customers, with the remainder coming from professional sales to mechanics and large shops. Opening at least 100 new stores every year since the turn of the century, O'Reilly has delivered an annualized revenue growth rate of 13% over the same time.

Marching across 47 states in the U.S. and, more recently, into Mexico and Puerto Rico, the company has bested the overall stock market over almost any time frame, including the last five years.

Despite this incredible run, O'Reilly's growth story still has room to run, with only 44 stores opened in Mexico. Recently, the company built its first distribution center in Mexico and appears ready to realize its full expansion potential in the area. This new center is expected to serve over 250 stores in the area and could act as a launching pad for O'Reilly's international expansion plans.

Historical outperformance indicators

However, as promising as this future growth is -- and the company's track record of increasing sales has been -- it is O'Reilly's immense profitability and subsequent stock buybacks that make it an incredible compounder.

Consider its return on invested capital (ROIC) of 68%, measuring its profitability to its debt and equity. Such a high ROIC signals that the company is masterful at investing in its operations as it continues expanding. Historically, stocks with top-tier ROICs have outperformed their lower-ranked peers, meaning O'Reilly's second-best ROIC among Nasdaq-100 members has the company well-positioned to beat the broader market.

Best yet for investors, this outsize profitability allows management to consistently buy back a staggering number of shares over time.

ORLY Shares Outstanding Chart

ORLY Shares Outstanding data by YCharts.

O'Reilly's share count has declined by 44% in the last decade, juicing the company's per-share figures. Consider the following chart to visualize the power of this lowering share count.

While O'Reilly more than tripling its net income since 2013 is impressive enough, its earnings per share (EPS) has more than doubled this growth rate thanks to the company's consistent share repurchases.

ORLY Net Income (TTM) Chart

ORLY Net Income (TTM) data by YCharts. EPS = earnings per share. TTM = trailing twelve months.

These share buybacks are even more exciting to investors because they tend to be a historical indicator of outperformance, much like a high ROIC. A study by S&P Global measured the top 100 buyback-heavy companies in the S&P 500 and found that they outperformed the index as a whole by 5.5% annually from 2000 to 2020.

With management expecting to generate between $1.9 billion and $2.2 billion in free cash flow (FCF) in 2023 -- the vast majority of which will go to buybacks -- O'Reilly's share count could drop another 3% or 4% in 2023 alone.

Why O'Reilly is perfect to buy and hold forever

Trading at a forward price-to-earnings (P/E) ratio of 24, the company isn't particularly cheap. However, the company's incredible profitability, consistent share buybacks, and massive growth runway make it a perfect stock for dollar-cost averaging (DCA) into when its share price dips. This way, you can take advantage of buying O'Reilly any time it dips -- just like management does.

ORLY Chart

ORLY data by YCharts.

With its sales and EPS growing by 11% and 16%, respectively, in its most recent quarter, look for O'Reilly to keep its finely tuned compounding machine running, making it a genuinely magnificent Nasdaq-100 stock to buy and hold forever.