It seems like it will be much easier for Walmart to close the gap against Amazon than vice-versa; Walmart has already done the harder part of getting a warehouse within 10 miles of most populated areas.
Californians or people in other anti-Walmart areas may not realize the nexus that Walmart represents for many Americans. In most places that are not actively anti-Walmart, it is one of the most frequent touchpoints for virtually everyone.
Amazon's retail operation is being threatened from Prime-like shipping offerings (free 2 day) from lots of online stores, including Walmart. Walmart can also often allow same-day pickup at a local store, whereas the only hope of getting something similar on Amazon is living within Prime Now range.
Amazon is also hurting its reputation as a retailer by allowing so much counterfeit material through FBA.
When you take away the retail core of Amazon, I'm not sure what consumer-facing value you really have left. They have Echo, but that's pretty meh. They have a crappy Netflix ripoff, which may hold some attention, but without a reason to shop at Amazon, the reason to use Prime Video is diminished. Google has them nicked pretty good on web and mobile platforms. You sort of get stuck with a group of loose things that are kinda good, but not really enough to hold interest independently, IMO.
If Walmart et al go in for the kill, I think Amazon's prospects as a consumer brand are weak. I suspect the only thing that keeps Walmart from seriously weakening Amazon is a dissonance between corporate values that keep them from competing on the same wavelengths (see Clayton Christensen).
Of course, AWS will continue to make gobs and gobs of money for the foreseeable future, but there's nothing really inherent about that either. Google is laying the foundation to plow over them in cloud via Kubernetes. With the right marketing buzz, AWS can be cast as outmoded and overpriced and hurt significantly on that front too.