Shares of America’s leading auto-parts retailers—Advance Auto Parts, O’Reilly Automotive, and AutoZone—have lost around 30% this year, on disappointing first-quarter earnings and fears that Amazon.com is about to muscle into the roughgly $125 billion U.S. auto-parts market. Yet, there are reasons to be cheerful about Advance Auto Parts’ outlook, in particular.

The stock’s valuation—it recently fetched $110, or 14 times next year’s expected earnings—would seem to discount a lot of bad news, while ignoring the potential for…