Coffee chain Starbucks (SBUX 0.47%) has proven to be a remarkably lucrative investment over its lifetime. Had you invested $10,000 at its initial public offering, you'd have over $3.4 million today. But even winning stocks fall into slumps, and Starbucks is currently in one, down roughly 28% from its former high.

So what gives? Starbucks has dealt with several issues, including new CEO leadership under Laxman Narasimhan. Additionally, the company has been trying to put out fires and persuade its workers not to unionize.

But history shows that now could be the time to buy the dip. I'll explain why you should consider buying Starbucks and holding the stock forever.

The core business is brilliant

Coffee is a cultural staple worldwide, allowing Starbucks to grow from a regional coffee chain into a global juggernaut with over 38,000 stores. It's a brilliant business model. Coffee is a profitable beverage to produce and sell, and Starbucks has thrived by building fantastic brand loyalty.

The company's loyalty program has a whopping 34.3 million Americans enrolled, with $3.6 billion on their Starbucks cards. Those funds are essentially an interest-free loan to the business, which management uses to open new stores or repurchase shares. That's helped drive years of solid revenue and earnings growth with little disruption along the way (aside from the pandemic).

SBUX Revenue (TTM) Chart

SBUX Revenue (TTM) data by YCharts

As profits grow, Starbucks returns more money to shareholders. The company has raised its dividend for 13 consecutive years and has repurchased enough stock to lower its share count by 25% over the past decade. Excellent investment returns are achieved when you take consistent, strong growth and juice it by lowering the share count. It's a formula that keeps working.

Working through adversity

Starbucks has also worked through some adversity. Shares were down nearly 40% from their highs in 2022, the stock's most significant decline since the late 2000s. The company had struggled to find a suitable replacement for former CEO and founder Howard Schultz. Ultimately, the company hired Laxman Narasimhan, formerly Chief Commercial Officer at PepsiCo. He has been the CEO of Starbucks for less than a year.

It will take time to see how Narasimhan performs. Notably, he may have scored an early win. The company has been grappling with employee dissatisfaction for the past few years. Store employees began unionizing around the U.S.

So in late February, the company announced jointly with Workers United (the union that store employees had been joining) that an agreement had been reached to discuss the framework for collective bargaining agreements, including ending ongoing litigation against the company.

Labor disputes can get ugly. Last year, automobile industry workers went on strike, costing automotive manufacturers billions of dollars in profit. Labor peace is a win for everyone, including investors.

How long will the discount on shares last?

Interestingly, Starbucks has been quite volatile over the years, routinely falling 30%. However, losing more than 30% from its high is pretty rare. As you can see below, there have been many declines, but most that extended past 30% were driven by significant stock market crashes, like in 2008 and 2020. If that trend holds, Starbucks might not fall much further than where it currently is.

SBUX Chart

SBUX data by YCharts

Fundamentally speaking, the stock is attractively valued today as well. Shares trade at a forward price-to-earnings (P/E) ratio of 22; analysts believe the company's earnings will compound by more than 15% annually over the next three to five years. Using a P/E-to-growth (PEG) ratio to compare the stock's valuation to its anticipated growth, the current ratio of 1.4 signals Starbucks is a solid buy, assuming it delivers the growth that analysts expect.

Shares are deep into on-sale territory, and there's no indication that Starbucks can't keep delivering on the formula that's made millionaires out of some long-term investors. Investors should do their homework, but it's hard not to like Starbucks as a stock to snap up and hold on to for the long term at today's prices.