What happened

Shares of Walgreen Boots Alliance, Inc. (WBA -0.11%) have lost 13% through the first half of the year, according to data from S&P Global Market Intelligence, as the world's largest pharmacy chain faced a rising threat from Amazon.com (AMZN 1.49%), which has been rumored to be looking for ways to penetrate the healthcare industry for much of the year.

In fact, Walgreen's slide this year was primarily the result of two separate Amazon-prompted sell-offs. The first came at the end of January, when Amazon said it would team up with Berkshire Hathaway and JPMorgan Chase to start their own health insurance company, and later at the end of June, when Amazon said it would acquire online prescription filler PillPack for $1 billion. 

The inside of a Walgreen store

Image source: Walgreen.

As the chart below shows, without those two events, Walgreen shares could very well be up so far this year. 

WBA Chart

WBA data by YCharts.

So what

Walgreen overcame a weak first-quarter earnings report in the beginning of January, as sales and gross margin disappointed, to post solid gains through most of the first month of the year. However, the stock began to slide once news broke of Amazon's foray into healthcare. No other company is seen as a disruptive force like Amazon, and the trio of giant companies declared healthcare ripe for disruption as Warren Buffett called health insurance a hungry tapeworm.

The stock gave up 12% over the course of the week after that announcement and popped briefly after a solid second-quarter earnings report in March before sliding again. Then, after trading mostly sideways for several months, it gained toward the end of June on news that it would be added to the Dow Jones Industrial Average before plunging when Amazon acquired PillPack, losing 10% on June 28 as the move made Amazon a direct competitor.

Now what 

Walgreen's slide this year has come despite strong earnings growth, prompting some to argue that the stock offers significant value today. In fact, the company announced a $10 billion share buyback program at the end of June, indicating that management believes the stock to be undervalued as it trades at a P/E of less than 11 based on this year's projected earnings. Throw in a dividend yield of nearly 3%, and investors may be making a mistake for punishing a healthy Walgreen's simply because of the Amazon threats. Grocery stocks mostly recovered after Amazon took over Whole Foods, and Walgreen and its peers could do the same as they adapt and the market's concerns subside.