It's easy to feel regret when you don't buy a stock that's had a successful run. And Walmart (WMT 1.34%) has certainly done well for investors over the years.

But a company can't live in the past, and investors shouldn't take it for granted that its success will continue. Determining what path Walmart will take requires understanding the business and management's plans for future growth.

With that, let's take a deeper dive into Walmart.

Someone pushing a cart in a store aisle.

Image source: Getty Images.

Timeless business

Walmart has a simple but appealing business concept. That's to minimize costs and pass these savings on to customers. That way, rather than offering sales, it can maintain everyday low prices that competitors have a hard time beating.

Offering consumers savings always has appeal, but particularly during difficult economic times. During the early days of the pandemic, Walmart produced strong results, with U.S. stores producing a same-store sales (comps) increase of 8.6% in fiscal 2021 (ended Jan. 31, 2021).

The Federal Reserve has indicated it will keep short-term interest rates elevated to battle inflation, which could affect the economy. And economic growth has shown signs of slowing, with the U.S. gross domestic product growing by 1.6% in the first quarter, down from 3.4% during the previous period.

While no one knows when a recession will happen, one inevitably will occur. Walmart's low prices mean it will likely see increased business.

Keeping up with the times

Fortunately, management isn't content to rest on its laurels. It has invested heavily in technology throughout the years, allowing Walmart to remain relevant and not become overshadowed by competitors such as Amazon.

It continues to improve its omnichannel capabilities, and many U.S. stores have same-day pickup. It also has a subscription service, Walmart+, that offers benefits like discounted gas.

No doubt, management's ability to move forward has contributed to Walmart's continuing success. Many prominent retailers have filed for bankruptcy over the years, but Walmart continues to grow sales and profitability. Fiscal fourth-quarter revenue grew 4.9% after foreign-currency translation effects are removed, and adjusted operating income increased 13.2%.

Collecting dividends

The company's profitability translates into plenty of free cash flow (FCF) -- $17 billion last year. Walmart rewards shareholders by using some of this prodigious FCF to pay dividends. The board of directors not only pays dividends, it has also increased payouts yearly since first declaring one in 1974. It extended the streak to 51 consecutive years in February, and the stock is a Dividend King.

Walmart has a 1.4% dividend yield, in line with the S&P 500 index. But the company also offers compelling growth prospects. That includes the fast-growing advertising business that saw last year's revenue increase 28%. Although the $3.4 billion in revenue was only 0.5% of Walmart's top line, management will acquire Vizio, which should help grow the business.

The decision

Walmart's stock valuation has become more compelling over the past year. The shares trade at a price-to-earnings (P/E) ratio of 32, compared to 36 a year ago. By comparison, the S&P 500 has a 27 P/E multiple.

While it's not a cheap valuation, remember that Walmart's business remains sound, and its prospects, even in an economic downturn, remain bright. Despite the stock's run-up, investors with a long time horizon should consider purchasing shares.