Walmart WMT wants to become the same behemoth in e-commerce that it is in brick-and-mortar retailing.

The world’s largest company is testing a subscription service like Amazon.com’s AMZN Prime membership, and it’s fine-tuning a grocery pick-up service in a few test markets. And those are just two of the steps Walmart is taking to narrow the gap with its e-commerce rival and stay ahead of a resurgent Target TGT .

Walmart generated $12.2 billion in e-commerce sales last year, a 22% jump over 2013. But that’s still just a small fraction of Walmart’s $288 billion in U.S. sales, and only about one-sixth of Amazon’s tally. So Walmart intends to further build its e-commerce muscles to help combat recently tepid growth in sales and traffic at its brick-and-mortar stores — especially when Amazon and others are pouring billions of dollars into their own e-commerce plans.

To do that, Walmart has in recent years equipped more than 80 of its U.S. super centers to help fill online orders and speed up delivery. That’s about the same number of distribution centers Amazon operates. The retailer now also lets shoppers pick up online non-grocery orders at any of its 4,500 U.S. stores, a concession to consumers’ growing demands for convenience. And Walmart recently opened four new automated distribution centers dedicated to filling online orders, each 1.2 million square feet in size — or as big as 20 football fields.

“We’re building best-in-class e-commerce that we then can integrate with the assets of the world’s largest retailer,” Neil Ashe, CEO of Walmart Global eCommerce, told reporters earlier this month in a briefing in Rogers, Arkansas, near Walmart headquarters. “We’ve built a tech company inside the world’s largest retailer.”

Walmart.com, based in San Bruno, California, near San Francisco’s airport, has grown to 2,500 employees from 500 only four years ago. Other Walmart initiatives include rolling out a simplified checkout process on walmart.com in the U.S. to improve the shopping experience on mobile devices, the source of most of retail’s e-commerce growth.

But as Wal-Mart Stores CEO Doug McMillon made clear on June 5 at the retailer’s annual shareholder meeting, there is a ton more to do. Walmart’s e-commerce grew 17% in the first quarter of 2015 from a year earlier — not bad, but slower than in recent quarters, and below Target’s growth rates. (To be fair, Target is starting from a much lower base, making it easier to post near-40% growth rates. Target gets 2.8% of sales online, vs about 4% at Walmart.) So what’s next for the retail giant online?

Walmart Primed?

To compete with Amazon’s Prime — a subscription service that garners repeat trips from customers who want to get their money’s worth for their $99 annual fee — Walmart is turning to the old-fashioned price competition on which it built its empire. Earlier in June, it started testing, on an invitation-only basis, a new delivery service called Shipping Pass. The unlimited free three-day delivery service costs $50 a year, or half of what Amazon charges for Prime, which currently offers free two-day shipping.

“We ultimately think that it will drive frequency, that it will drive a deeper relationship with Walmart,” Ashe told a Goldman Sachs conference on Thursday, almost two weeks into the pilot. What customers want above all, he noted, was “predictability” and “low cost” in delivery services.

Amazon intends to aggressively protect its turf: a few weeks ago, it waived the fees for same-day delivery wherever that service is available to Prime members. (Walmart tested same-day delivery two years ago in 10 markets. But Ashe told Fortune, “What we found was the customer wanted certainty more than they wanted that level of speed.”)

Where Walmart could prove to be a particularly formidable rival to Amazon and its AmazonFresh service, a service similar to Prime but for grocery in that new front in the delivery wars.

Walmart gets 56% of U.S. sales from food (or about $161 billion last year), making it by far the biggest U.S. grocer, with much more expertise in selling food than Amazon. It’s testing out a kiosk, called Walmart Pickup-Grocery, near its headquarters in Bentonville, Arkanasas, that looks a lot like a gas station (see below) but is really a new way to get groceries to customers.

Here is how it works: After a customer has placed an order online, paid and scheduled a pick-up time, he or she can pull up to the kiosk at the designated time, and punch in a code that tells the customer where to pull up. A Walmart worker then delivers the order to the car and prints off a receipt, similar to a car-rental check-out, before sending the customer on his or her way.

The 15,000-square-foot pilot kiosk is a modified version of a service developed by the company’s Asda chain in Britain. For now, it’s the only one. But Walmart is also testing grocery delivery with order pickup at regular stores in four other U.S. markets: San José, Denver, Phoenix, and Huntsville, Alabama. Wal-Mart’s Sam’s Club warehouse club business now offers grocery pick up at its 651 stores. The ability to offer both kinds of services by using assets Amazon doesn’t have- a network of stores– is what the company is betting on to differentiate it from Amazon.

“What I think sets us apart is we can get both of those right: we can get delivery to your door right, and we can the pickup experience in our store right,” Ashe said at the Goldman conference.

6922-walmartpickup-459

(Photo courtesy of Walmart.)

More generally, the company is expanding its online assortment. Walmart said it will offer 10 million different kinds of items (shelf-keeping units, or SKUs, in retail parlance) online by year-end, compared to 7 million now and 700,000 just a few years ago. That is dwarfed by Amazon’s 250 million-item selection. But it’s a much bigger selection that what is available in a Walmart super-center large-format store, which typically stocks only 100,000 SKU’s.

Walmart is already the No. 2 e-commerce retailer in the U.S., having just surpassed Apple. No one doubts it has the will and the clout to make that business much, much bigger. The goal is front-and-center in Doug McMillon’s plan to adapt for the digital age the 50-year-old business model Sam Walton used to turn a five-and-dime store in Northwest Arkansas into the biggest company in the world.

“One customer can shop with us in so many different ways: in stores, on their phones, at home,” McMillon told a crowd of 14,000 Walmart shareholders and workers two weeks ago at an arena in Fayetteville, Arkansas. “We’ll win one customer at a time.”