Walgreens Boots Alliance (NASDAQ:WBA) is a retail pharmacy giant that owns thousands of stores across the U.S. The 120-year-old company has become a household name for many Americans. But its business model is facing some serious challenges, especially as more consumers turn to online resources for healthcare services and prescriptions. Amazon, which is increasingly focusing on the healthcare market, is just one tech player looking to disrupt the pharmacy sector with its new service, Amazon Pharmacy.

But Walgreens is adapting and making changes in the hopes that its in-store offerings will become more attractive to consumers -- but will the strategy pay off? If it doesn't, that could make Walgreens a risky investment and may even put its impressive streak of dividend increases in danger.

Medical products in a pharmacy.

Image source: Getty Images.

How strong is its business right now?

On Jan. 7, Walgreens released its first-quarter earnings for the period ending Nov. 30, 2020. Sales weren't all that bad, growing 5.7% year over year to $36.3 billion. It incurred a loss of $308 million compared to a profit of $845 million in the prior-year period, but that was due to an equity loss it reported on its investment in AmerisourceBergen which totaled $1.4 billion. Otherwise, it would have been a solid, profitable quarter for the company.

Looking ahead in 2021, Walgreens has said that it can vaccinate tens of millions of Americans against COVID-19. But the company cautions that any gains it will get from that will likely just barely offset the negative effects of the pandemic, which include people not visiting its pharmacies as often.

Walgreens knows it needs to make some serious changes to its business if it wants to stay competitive with online threats from Amazon, which owns PillPack and launched Amazon Pharmacy in November 2020. One way that it is doing that is by focusing more on its retail operations and expanding its offerings to encourage customers to keep coming into stores. Just prior to the earnings release, Walgreens announced it was selling off the bulk of its wholesale pharmacy business to AmerisourceBergen for $6.5 billion. Last year, the company announced it was investing $1 billion in VillageMD and that it will launch up to 700 primary care clinics in the U.S. over the next five years. The clinics will be at its stores, allowing consumers to make a trip to the doctor's office while visiting their local Walgreens pharmacy.

But the problem here is that by stepping into healthcare, Walgreens may also be creating more competition for itself. Walmart has launched health clinics in select locations in Georgia, Arkansas, and Illinois. And in 2021, it plans to open more clinics in Florida. Its low-cost health services, including primary and urgent care, could make the big-box retailer even more of a one-stop shop for consumers than it already is. Walmart's healthcare expansion is still in its early stages, but it could be another potential obstacle in the way of Walgreens' future growth.

For investors, that doesn't make the outlook terribly rosy given that Walgreens typically operates with razor-thin margins that have been no higher than 3% in any of the past five quarters. However, if you're primarily a dividend investor, your main concern may be more about what the cash position looks like for Walgreens rather than its growth potential.

Is Walgreen's dividend safe?

One of the best reasons to invest in Walgreens is for its dividend. With a yield of 3.8%, you're earning a better payout than the average stock on the S&P 500, which pays about 1.6%. And the best part is that the company has an impressive track record for increasing dividend payments. A Dividend Aristocrat, Walgreens has raised its payouts for 45 years in a row -- five more increases, and it becomes a Dividend King.

With the influx of cash it received from the sale of its wholesale unit, money won't be a problem for Walgreens anytime soon. And during the last quarter, the company generated $1.2 billion in cash from its day-to-day operating activities. Investing activities totaled just $259 million and left plenty for the company to pay its cash dividends of $405 million. For dividend investors, the company is in a strong cash position that should make it likely for Walgreens to continue paying and possibly raising its payouts for the foreseeable future. Although investors may be concerned that the company has a negative payout ratio, it's important to remember that accounting income (which the payout ratio takes into account) includes non-cash expenses, and that can sometimes make the business look like it's in worse shape than it really is.

Should you invest in Walgreens stock today?

In the past 12 months, Walgreens stock has fallen 6% while the S&P 500 has risen by more than 18%. Its forward price-to-earnings (P/E) ratio of 9.9 puts the stock's valuation a little higher than rival CVS Health, which trades at close to 9.4 times its future profits. They are both cheap buys when put in the context of the S&P 500, where the average stock trades at multiples of more than 28 times earnings.

However, that's not necessarily enough of a reason to say that Walgreens is cheap and therefore a good buy. If the moves the business is making today don't pay off, the stock could just end up becoming a value trap. With low margins and lots of competition, it is difficult to be optimistic on Walgreens' future. So, unless you are in it for the dividend, this is a healthcare stock you should probably avoid, at least until it can find a way to generate some more convincing and sustainable growth.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.