Wal-Mart (NYSE:WMT) has struggled during the so-called retail apocalypse. The chain never found itself in the same dire straits that some of its rivals did, but for a period it was reasonable to wonder if Amazon.com (NASDAQ:AMZN) was going to be able to take a meaningful piece of its business. That's still a risk, but it's much less of one since Wal-Mart spent $3.3 billion buying Jet.com.

That deal was incredibly rich -- probably more than the company had to pay to buy a money-losing start-up with around $1 billion in sales -- but Wal-Mart got something very important for its billions: Jet.com CEO Marc Lore. The serial entrepreneur, who previously sold Quidsi to Amazon, now runs Wal-Mart's entire digital operation.

That's very good news for Wal-Mart shareholders, as Lore has injected start-up thinking into a mature company. That has already shown some payoff for the company, as it reported a 63% gain in online sales in Q1 2018, which the company said was mostly organic through Walmart.com.

A worker prepares a digital order at Wal-Mart.

Wal-Mart is improving its internal flexibility to deliver digital orders. Image source: Wal-Mart.

What has changed at Wal-Mart?

Before Lore came on board, Wal-Mart was a bricks-and-mortar retailer that also had a website. It used store-first thinking that crippled its efforts to grow its digital presence.

As the new e-commerce boss, Lore made the public change of scrapping the company's $50-a-year Amazon Prime knockoff, ShippingPass. That program, despite being half the price of Prime, wasn't working, and Lore made the bold choice to offer free shipping on any order of eligible items over $35.

That deal may not entice many Amazon customers to switch, especially because Prime has over 50 million eligible items while WalMart.com has only about 2 million. It will, however, give Wal-Mart's customers a reason to use its website rather than Amazon.

The biggest change Lore has made, however, is a top-to-bottom overhaul of how Wal-Mart thinks and how it organizes its operation. He had worked, with the support of CEO Doug McMillon, to revamp the company's supply lines and change its in-store system to facilitate shipping online orders, in-store-pickup, and store-based returns for online orders.

"We're transforming to become more of a digital enterprise," McMillion said during the Q1 earnings call. "The change is starting to be visible to our customers as they use online grocery, Walmart Pay, Scan & Go at Sam's Club, and our Walmart app to skip the line when using our pharmacies and financial services in our U.S. stores."

Why is this important for Wal-Mart?

While Wal-Mart was never in danger of going out of business if it hadn't addressed its digital problem, it would have struggled to grow. By offering a viable alternative to Amazon, the company quite simply raises its ceiling, giving it more customers it can reach.

That's something Amazon has clearly noticed, as the online leader recently lowered the price of Prime for lower-income customers from $99 a year to $5.99 a month with no long-term commitment. The program requires a valid electronic benefits transfer card to qualify for the discounted membership, and it certainly seems like a way to counteract Wal-Mart's efforts.

This won't be easy

The presence of Lore, who has shown he knows how to take on Amazon, gives Wal-Mart a chance, but it's not going to be a steady ride. Offering free shipping may win customers, but it hurts margin. Amazon has shown a willingness to make that sort of sacrifice, and if Wal-Mart does the same, it may suffer short-term pain to build long-term success.