E-commerce leader Amazon.com (NASDAQ:AMZN) single-handedly changed the retail landscape with the massive success of its online shopping platform, leaving many traditional retailers struggling to catch up. One of the most high-profile examples is that of Walmart (NYSE:WMT). The world's largest retailer was in danger of being left behind, until it made the biggest bet in its history. Walmart spent $3.3 billion to acquire thriving e-commerce start-up Jet.com and its visionary founder and CEO Marc Lore.

That strategy appeared to pay off. In each of the past two years, Walmart reported e-commerce sales growth that significantly outpaced the rest of its retail operations. Online sales grew by 40% last year, on top of 44% growth achieved in the prior year. This shows that the company is in a much better position to compete in the digital economy.

Unfortunately, all that success is not making its way to the bottom line.

Losses are mounting

Walmart expects its U.S. e-commerce operations to lose more than $1 billion this year on revenue of between $21 billion and $22 billion, according to a report by Vox's Recode. To make matters worse, while Walmart has made a dent in Amazon's lead, it's been a very small one. Amazon was responsible for about 38% of online retail in the U.S. last year, up from 32% just two years ago, according to eMarketer. At the same time, Walmart's digital sales grew to 4.7%, up from 2.6% -- still far behind Amazon's dominant lead.

It's also a far cry from Walmart's industry-leading retail, which generated sales of $515 billion and profit of nearly $7 billion last year.

Investors shouldn't be shocked

It shouldn't be surprising that the company's online aspirations would be awash in red ink. Walmart has continued to invest heavily in the infrastructure and logistics network necessary to compete in the realm of e-commerce.

Consider Amazon's international segment, where the company is still trying to achieve the same scale that makes its U.S. market so profitable. Even after years expanding its global operations, Amazon lost more than $2 billion on its international segment last year -- and that's on top of a $3 billion loss the year before. This illustrates just how costly it is to put a system in place to orchestrate the world of e-commerce.

Back in the U.S., Amazon has much of its logistics infrastructure in place, a process that has been ongoing for more than two decades. This includes 110 fulfillment centers across the nation -- while Walmart has just 20. Amazon also has a huge shipping network in place, and the company recently moved to offer free one-day shipping on millions of products, just as competitors like Walmart were working to fully establish two-day delivery.

The big picture

Even though Walmart's online sales segment is currently losing money, it's important to look at the big picture. Amazon opened Pandora's box with its success in e-commerce, and there's no going back: Consumers have become accustomed to placing an online order and having it delivered rather than running out to the store. This is the business reality, and Walmart has no choice but to compete with Amazon. If it doesn't adapt to this new retail paradigm, it will simply fade into obscurity.