From a big-picture perspective, Walgreens Boots Alliance (WBA -1.27%) is pretty easy to understand. It is a pharmacy.

But there's a lot more to this story than meets the eye. Investors have soured on the stock in a big way given that it is down nearly 60% from its 2015 high-water mark. Here's a look at what's going on and why Walgreens might end up a long-term winner.

A business in flux

In 2014 Walgreens bought Alliance Boots to create a global retail pharmacy business. Between 2014 and 2018, revenue grew fairly quickly, driven by the merger, but then started to flatline. Leverage jumped after the merger and has remained well above pre-deal levels. The merger just doesn't appear to have lived up to expectations and investors reacted as you might expect.

Two people looking at paperwork with a calculator.

Image source: Getty Images.

In what appeared to be a recognition of the troubled pair-up, Walgreens was looking to sell Boots. However, the market turbulence led it to abandon that plan. While the company now intends to keep Boots in the fold, it wouldn't be a shock to see a sale or spin-off possibility come back up when markets are less jittery. 

While this drama was unfolding, the company has been slimming down in other ways. Notably, it agreed to sell its wholesale drug business to AmerisourceBergen (COR -0.70%) for cash and stock. Wholesale was expected to be an important growth driver at one point, but clearly hasn't panned out as well as hoped, either. Walgreens has been selling the shares it received to raise cash for other purposes, like debt reduction. 

The opportunity ahead

So far the story sounds less than inspiring, with Walgreens making moves that just didn't work as well as hoped. Investors shouldn't ignore this fact, but with the stock down so much since 2015, it seems Wall Street priced in a lot of bad news, which brings up the potential for the future.

Walgreens has recently been moving into the medical services space, building a controlling stake in VillageMD. That company provides primary care services. VillageMD recently increased its size, with the help of Walgreens, by acquiring Summit Health-CityMD.

The big benefit here is the opportunity of putting primary care offices inside of Walgreens' stores. Not only does that add a new revenue stream to the pharmacy's business, but it can also help increase drug sales and sales on the retail side of its stores. It seems like a solid business plan.

But here's the interesting thing. Despite the trouble Walgreens has had since the Boots deal, it has continued to increase its dividend every year. The annual streak is over four decades long. This history suggests that Walgreens can handle adversity while continuing to reward investors well for sticking around through the difficult times. The dividend yield today is a generous 4.9%. That's historically high and suggests the shares are cheap.

Act while Wall Street dawdles 

If, perhaps when, Walgreens starts to gain traction with its new business direction, investor attitudes around the stock should change in a positive direction. It wouldn't be surprising if Wall Street's reaction to improved results were quick, given the deeply negative mood here. It isn't easy to like a company that's made mistakes, but with what appears to be a more complementary business combination and its proven ability to weather adversity, more adventurous types might want to reconsider this Dow 30 retailer before other investors start to see the upside potential and its shares get revalued.