As you remember, Walmart was in a perfect position 15-20 years ago to be Amazon.
Yes, they were. But 15-20 years ago they were solidly in #1, so they weren’t under pressure to change their business model. Amazon was a lean and hungry bookstore that took a chance and did/is doing very well. When they bought Whole Foods, I think that Walmart realized that they could and should strike back, since Walmart was starting to intrude on their turf.
In any case Walmart is responding in a way that Sears (bless their heart) couldn’t/wouldn’t.