Walmart (WMT 0.57%) and Amazon (AMZN -1.65%) have been going toe to toe over the years, battling each other in multiple forums. Amazon has expanded into grocery stores with the purchase of Whole Foods back in 2017. Walmart, meanwhile, has become more aggressive as an online retailer. Their businesses look to be on a continual collision course as both companies keep seeking out the next big growth opportunities.

One area where they have both been showing an interest of late has been healthcare. They are investing money into offering healthcare solutions, which begs the question of whether or not this could be the next big battleground for these two companies. Here's why that could be the case, and what that means for investors.

Both companies offer low-cost medications

Last month, Amazon introduced a new service, RxPass, which would allow Prime members to get generic medications from Amazon Pharmacy delivered to their door for a flat $5 per month fee. Amazon Pharmacy has medications that treat more than 80 health conditions and can help customers save money on their prescriptions.

Walmart has pharmacies inside its stores, and it too offers consumers a way to obtain low-cost medications. For certain common medications, it offers 30-day doses for just $4 and 90-day doses for just $10. While this isn't for a flat monthly fee, Walmart has focused on giving its customers a way to save on medication as well. And with Amazon's latest move to offer a fixed-price plan, it wouldn't be surprising if Walmart did the same soon.

A growing interest in primary care

Another way these businesses could be competing against one another is through the services they offer. Last year, Amazon announced plans to acquire primary care provider 1Life Healthcare, which would give it a physical presence in many markets around the country. It was also in the running to acquire home health company Signify Health. It ultimately lost out to CVS Health, but it's a definite sign that Amazon isn't just content with offering prescriptions.

Walmart, meanwhile, has been expanding healthcare services at its stores. It launched Walmart Health in 2019, and has been growing its presence to more than two-dozen locations, including in Illinois, Florida, Georgia, and Arkansas. At Walmart Health, people can get access to primary and urgent care, and even dental and optometry services as well.

It may take a while for these companies to develop their brick-and-mortar healthcare services, but this is another area where they may end up competing against one another.

What does this mean for investors?

Walmart and Amazon are two businesses that investors should be taking more seriously as healthcare investments. They aren't big names in the industry right now, but given their vast resources and the fact that they're among the largest companies in the world, Amazon and Walmart have the potential to grab significant market share in the industry. And they pose significant threats to pharmaceutical retailers like CVS and Walgreens Boots Alliance.

It's good news for investors, because an investment in either Walmart or Amazon can give you a way to invest in a more diversified business, one that is benefiting from growth opportunities in the healthcare industry. Even if you're not sure which company will be more successful in its venture into healthcare, you could simply invest in both.

Amazon and Walmart are solid businesses that are likely going to get bigger and more profitable over the long haul.