The stock prices of the two largest U.S.-based automotive manufacturers have soared over the past 12 months. Ford (F -1.93%) is up an incredible 89%, while General Motors (GM -1.85%) isn't far behind, up 68%. The ongoing global push to incentivize sales of fuel-efficient vehicles has revived these Detroit automakers, and their share performances represent this investor optimism. 

Both Ford and GM have significantly outperformed what I believe to be a superior auto stock, and that is O'Reilly Automotive (ORLY 1.16%). The leading auto parts retailer is fundamentally a better company than the car manufacturers. 

Let me explain why.

Row of cars on a lot.

Image source: Getty Images.

Detroit, we have a problem 

Ford and GM, like most other automakers, possess characteristics that make their business models unattractive for quality-focused investors. 

For starters, revenue is extremely cyclical. When the economy is doing well with low unemployment and solid GDP growth, it's no surprise that consumers are more willing and able to buy new cars. But on the flip side, when times are tough, many people will hold off making a purchase. Because of this, both Ford and GM experienced substantial sales declines in 2008 and 2009 during the financial crisis. O'Reilly, on the other hand, registered revenue growth of 41.8% and 35.5% in those same two years, demonstrating its recession-proof nature and benefiting from consumers extending the life of their existing vehicles. 

Designing and building cars is also very expensive, incorporating the cost of parts and labor. In the most recent quarter, Ford and GM had gross margins of 10.7% and 14.8%, respectively. Even in a period with limited supply and surging demand, this exemplifies the subpar financial profile of the industry. O'Reilly's gross margin in the second quarter was a remarkable 52.7%. What's more, its Q2 operating profit margin of 23% absolutely trounces that of the two automakers. 

And finally, the competitive dynamics of the auto manufacturing business are simply inferior to the aftermarket parts industry. Ford and GM have shown a vulnerability to technological disruption. Electric vehicle pioneer Tesla essentially changed the landscape of the entire industry, forcing carmakers across the world to pursue their own electric vehicles or risk falling behind. There is currently a plethora of well-funded automotive start-ups, with billions of dollars raised, trying to stake their claim as well. 

Selling batteries and brake pads at brick-and-mortar locations doesn't attract the same level of attention from disruptors, which supports O'Reilly's economic moat. Over the years, the company has developed and fine-tuned an efficient and reliable supply chain and distribution network. O'Reilly is successful because it can get the right parts to its customers at the right time. It would take years for a newcomer to even try to compete with this, let alone earn consumers' trust.  

The aftermarket parts business is booming 

O'Reilly reported another fantastic quarter, with same-store sales (or comps) increasing 9.9% compared to the prior-year period. This is impressive because in Q2 2020, comps jumped 16.2% as people increased spending on their cars in the absence of leisure and entertainment options. O'Reilly has proven to be recession resilient in the past, but this performance proves that the company can thrive in robust economic times as well. 

With a retail footprint of 5,710 stores and trailing 12-month revenue of $12.6 billion, O'Reilly is one of the largest automotive aftermarket suppliers in the country. And management's confidence in the trajectory of the business resulted in upgraded guidance for the full year. 

"As a result of our second-quarter performance and strong start to our third quarter, coupled with our confidence in Team O'Reilly's ability to provide industry-leading customer service, we are raising our full-year 2021 guidance for comparable-store sales from a range of 1% to 3% to a range of 5% to 7%. We are also increasing our full-year diluted earnings per share guidance to a range of $26.80 to $27, which represents an increase of $2.05 at the
midpoint from our previously provided guidance." CEO Greg Johnson explained.

Investors have plenty to cheer about with this all-weather, low-risk stock. 

The final word 

Ford and GM are experiencing a resurgence as the world slowly shifts to electric vehicles. But the auto manufacturing business is burdened with its own set of disadvantages. The economics of the industry are just not beneficial for long-term investors. 

Additionally, over the past three-, five-, and 10-year time periods, O'Reilly's stock has crushed that of Ford and GM. Keep this in mind when choosing which auto stock you want to invest in.