Wal-Mart is the biggest retailer in the world with $482 billion in annual sales, making it fives times as large as its closest rival. 

But there's one area where the retailer is perpetually beat: E-commerce. 

Wal-Mart's online sales are a tiny fraction of the size of Amazon's, even though Wal-Mart is five times bigger — and a lot older — than it's e-commerce rival. 

Wal-Mart's online sales were $12.2 billion in 2014. By comparison, Amazon's were $89 billion. 

The world's largest retailer is tired of losing to Amazon when it comes to web sales, so it has been pouring billions of dollars into its online operations in recent years. 

This year, Wal-Mart plans to invest between $1.2 billion and $1.5 billion in its e-commerce business, Wal-Mart Chief Financial Officer Charles Holley told analysts in February. The company will spend even more next year, he said. 

Wal-Mart has been using the money to make its website more user-friendly, open additional e-commerce fulfillment centers around the US, and expand the number of products available for purchase on its website. 

Wal-Mart also recently began authorizing store managers to match prices on Amazon.com and other websites to better compete with its rivals.

And Amazon's growth continues to outpace Wal-Mart's, meaning the retailer is a long way from catching up. 

Now the company is using a more direct tactic by attacking Amazon head-on and trying to erode its loyal customer base.

After Amazon announced that it would have a Black-Friday-style sale for Prime members last week, Wal-Mart stole its fire by offering its own shopping event — starting on the same day — with thousands of online-exclusive discounts.

In announcing its sale, Wal-Mart chided Amazon for making "Prime Day" available only to Prime members, who pay $99 a year for free two-day shipping and other perks.

"We've heard some retailers are charging $100 to get access to a sale," Walmart.com CEO Fernando Madeira wrote in a blog post. "But the idea of asking customers to pay extra in order to save money just doesn’t add up for us. We're standing up for our customers and everyone else who sees no rhyme or reason for paying a premium to save."

The attack got a rise out of Amazon, which responded by accusing Wal-Mart of charging customers higher prices in stores than they do online.

Wal-Mart has historically been very aggressive about going after its competitors.

According to Wal-Mart founder Sam Walton's book "Made in America," the company was built almost entirely off of other retailers' good ideas.

"Most everything I've done I've copied from someone else," Walton writes in the book.

One of Walton's first jobs in retail was running a franchise for Ben Franklin, a chain of discount stores.

While he was running the Ben Franklin store, Walton was obsessed with studying his closest rivals — one of which was located right across the street from his store. 

"What really drove Sam was that competition across the street — John Dunham over at the Sterling Store," Walton's wife, Helen Walton, recalled in the book. "Sam was always over there checking on John. Always. Looking at his prices, looking at his displays, looking at what was going on."

Later on, when Walton built the first predecessor to Wal-Mart in Bentonville, Arkansas, he copied everything from Ben Franklin — from the accounting system to shelving.

"Although we called it Walton's Five and Dime, it was a Ben Franklin's franchise," Walton writes. 

Walton was manic about following every new idea in retail.

"I read an article about these two Ben Franklin stores up in Minnesota that had gone to self-service — a brand-new concept at the time," Walton writes. "I rode the bus all night long to two little towns up there — Pipestone and Worthington. They had shelves on the side and two island counters all the way back. No clerks with cash registers around the store. Just checkout registers up front. I liked it. So I did that too."

CEO Doug McMillon says copying competitors is still a core part of the company's strategy.

"I mean going all the way back to [Wal-Mart founder] Sam Walton, we had a part of our DNA that was interested in learning from others," McMillon told PBS' Charlie Rose in an interview last year. "Copying good ideas. Don't be so proud that you can't implement a good idea."

One of the main competitors of interest to Wal-Mart right now is Amazon, he said. 

"We believe in learning from other people," McMillon said in the PBS interview. "And what Amazon’s doing and what [Amazon founder Jeff Bezos is] doing is showing us and showing the world what’s possible, and I admire that."

When asked what he admired about Amazon's business, McMillon said: "Very customer focused. Moving with speed. Just putting ideas at work that are directly beneficial to customers."

NOW WATCH: The one reason Zara is dominating the fashion industry right now

See Also:

The juice industry might be headed for a crashMeet the cows behind Chick-fil-A's most successful campaignMcDonald's is selling a $14 value meal with lobster