For decades Amazon (NASDAQ:AMZN) has been investing heavily into its expansion from a small book retailer when it started to the global everything store it is today. Several big retailers no longer in existence today can partly blame Amazon for their demise.  

Walmart (NYSE:WMT) is not taking Amazon lightly. The biggest retailer in the world, when measured by annual sales, is adjusting to Amazon's attempt to encroach on its business. In fact, Walmart is taking some tricks from Amazon's toolbox. Here's how Walmart is fighting back.

Two boxers fighting.

Image source: Getty Images.

Walmart is giving Amazon a taste of its own medicine

One of the biggest changes Walmart is making starts with capital investment. As recently as 2015, Walmart spent 60% of its capital investment budget on new stores. There is now a Walmart within 10 miles of 90% of the American population. Now Walmart is shifting investment spending to improving processes and efficiency. 

And a big part of that will go into its supply chain. Walmart's e-commerce business is about twice the size today compared to where it was a year ago. To support that growth, it is building out fulfillment centers with the latest technology. The improved efficiency can boost profit margins long term as it finds ways to automate where possible and increase worker productivity in jobs that can't be automated. In some ways, Walmart can have the second-mover advantage here as it learns from Amazon what works and what doesn't.

Another area Walmart is learning from Amazon's playbook is grocery delivery. Walmart is leaning into the service and considers it an important feature of its services to customers. Certainly, Walmart's physical presence near 90% of the American population makes grocery delivery an area where it can compete and have a good chance at sustaining market share. 

Interestingly, Walmart believes it can be the industry leader in an area that Amazon currently dominates. Third-party sales on Walmart's site increased by triple digits in a few quarters last year. Given the amount of traffic Walmart drives to its website, it believes it is in a natural position to take the lead in the market. If it succeeds in the coup, it will do wonders for Walmart's profit margins.

Will it be enough? 

Walmart announced it was increasing capital spending by 40% to $14 billion from $10 billion in the year prior. Still, that's peanuts compared to the over $45 billion that Amazon has spent in the last 12 months. It's important to note, however, that Walmart's spending will be more focused on retail. Meanwhile, Amazon has a plethora of categories it is spreading investment to, including but not limited to: retail, media content, and cloud services. 

And it could be argued that since Amazon's web services segment brings in the bulk of its operating income, that's the area of primary focus for Amazon. It could very well be that Walmart's focus means it does not have to spend as much to build a defensible moat around its business. However, it turns out, the battle between these two giants of the industry will be interesting for investors to follow. 

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.