For a long time, Walmart (NYSE:WMT) dominated retail with many of the same tools its chief rival, Amazon (NASDAQ:AMZN), uses now. The company was able to leverage its size and purchasing power to keep prices low while its network of stores made it convenient for consumers to shop there.

The brick-and-mortar retail giant still has those advantages over the vast majority of its competitors. Amazon, however, has gained an edge in convenience over Walmart. The online leader has perfected two-day delivery, and for many shoppers, that's fast enough.

Walmart was slow to adjust to the demands of the digital consumer. For years, its website was inferior to Amazon's, and its infrastructure was not set up to ship individual orders. Now, though, Walmart has woken up, and it's putting billions into catching up.

A Walmart online order pickup kiosk.

Walmart has integrated its stores and digital offerings. Image source: Walmart.

What is Walmart doing?

The company started its digital revival with the purchase of for $3.3 billion in October 2016. That deal was heavily questioned at the time, but it brought CEO Marc Lore and his executive team into the Walmart family.

Lore took over the company's digital operations, and he began to make major changes. His biggest splash was admitting that Walmart can't compete with Amazon Prime. He dropped his company's similar service and instead made two-day shipping free on qualifying orders over $35.

Behind the scenes, Lore worked to revamp Walmart's systems. This included building up capacity to ship individual orders from stores. That's not a small change given that the company's supply chain had been engineered to supply stores, not fulfilling individual orders.

Lore and the Walmart team are also working to leverage the asset they have in its brick-and-mortar locations. That has included offering lower prices on some items in stores, offering kiosks for picking up online orders, and making it easier to return online orders in stores.

A work in progress

Some of what Lore is doing is a test, and not everything will stick. For example, the company has programs offering curbside pickup for grocery orders, and it's testing same-day grocery delivery in some markets. It's hard to know if either of those will become nationwide offerings -- or whether consumers actually want them.

In reality, it doesn't matter what works and what fails. What's important is that Walmart has shaken off its legacy as a lumbering market giant that uses brute force instead of innovation to succeed.

The company has become a buy once again because it's innovating and changing its business to adapt to current market conditions. Walmart has the money to compete with Amazon -- it always has -- but Lore has shown the retailer that its old model would not work.

The Walmart edge

Walmart still has a pricing edge over most of its competitors. If it can further develop its digital properties while evolving its supply line capacity, it should be able to fully compete with Amazon while leaving most other retailers competing for niche markets.

It's still good to be a giant, but it's important to be a smart giant. Walmart was slow to adapt, but it has caught up quickly. The company now understands that experimentation, a willingness to adapt, and constant change will help it maintain its market advantages.

That's more expensive than simply having the most stores with the lowest prices, but that model was made less relevant by Amazon. Walmart will continue to grow because it has let the past go, and it has a digital leader in Lore who has shown that he can adapt as market conditions change.

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.