Walmart is the only retailer with the size, scale and funds to take on Amazon, and it’s been making aggressive moves to compete with Amazon’s online business for years. Amazon, on the other hand, has been trying to figure out how to merge brick-and-mortar stores into its world of online shopping.

The question is, which retailer will figure out the perfect mix of online and offline, and get there the quickest?

The truth is, Amazon needs to capture the Walmart shopper as it has saturated the middle to high-end of the market with Prime memberships; approximately 60% of U.S. households now have Prime, with lower-income households the only place it can still grow Prime stateside.

Beyond its Prime cash cow, Amazon has also made moves to better tackle the grocery business – a tough area to compete as an online-only retailer, given the need to keep fresh items cold, and others frozen. Amazon has slowly ramped up in this area over the years via its delivery service AmazonFresh, but it has not been able to widely scale grocery deliveries due to the logistics and economics (or “enormous money pit,” more colloquially) involved with delivering perishable items.

Amazon, on the other hand, is still a relative newcomer to brick-and-mortar retail, compared with Walmart. Though it just opened its own drive-up grocery pickup service in Seattle, many of its effort in brick-and-mortar feel more experimental.

For example, it’s trying out physical bookstores in major markets around the U.S., which also double as a gadgets showcase as well as a test of using online purchase data to inform store inventory selections. It’s also testing a new smart convenience store format with its cashier-free “Go” convenience stores, which could give it another angle into the grocery business.

But Amazon doesn’t have the wealth of institutional knowledge about physical retail, much less real-world grocery stores, like Walmart does. That’s why it makes sense that it’s today making a huge grab for a grocery retailer like Whole Foods – not only does that give Amazon the edge when competing against the likes of delivery startups like Instacart and Shipt in home grocery delivery (in fact it now owns a part of Instacart, thanks to Whole Foods), but it also gives Amazon a nationwide retail footprint to take on Walmart in grocery pickup.

What both retailers understand is that shopping will not fully transition online – at least not in the foreseeable future; nor will it operate entirely offline, either. It needs to be a mix. There are times when people still want to shop out in the real world – whether that’s because they like the experience of seeing products in their hand, because it can be more convenient or even just quicker to just shop in a store at times, rather than searching a website and waiting for delivery.

While Amazon is putting up stores – and now buying a whole host of them through Whole Foods, Walmart is figuring out how to make its online catalog more competitive. Ahead of today’s Bonobos deal, it’s been making strategic acquisitions in one of the fastest-growing categories of online shopping – apparel – in addition to having beefed up its tech team by spending $3 billion on Jet.com, led by Marc Lore.

Lore, of course, is the entrepreneur crazy enough to take on Amazon not once, but twice – first with Quidsi (Diapers.com’s parent company), and then Jet. And Jet’s innovation in exposing the underlying logistics of online shopping through its “Smart Cart” technology – which rewarded shoppers with savings for buying from nearby warehouses, or shipping items together, among other things – has since been translated to Walmart through the new “Pickup Discount” program.

Both systems approach the problem of bringing the costs of e-commerce down by allowing the customer to make choices about what they’re willing to do to lower item prices. In Walmart’s case, those choices are more about how to bring its retail stores into that equation.

In addition, through its Jet.com subsidiary, Walmart is snagging online businesses that can help it better compete with Amazon in areas where it may lack inventory. Jet acquired acquired home goods store Hayneedle, a Zappos competitor called ShoeBuy, and clothing retailer ModCloth, while its parent Walmart just last month bought outdoor retailer Moosejaw, which also has physical stores.

Several of these moves are about Walmart expanding its position in apparel, now the largest category for online retail, according to comScore. Amazon has been approaching this category from another angle – making its own-label fashion items, including workout clothing, bras, and men’s shirts, for instance.

However, apparel sales are still challenging online, due to sizing issues, fit, and the high cost of managing returns. As Walmart inches into apparel through its combination of offline/online clothing shops, it can do things like offer try-on, pickup and returns of online apparel at local stores. Amazon, on the other hand, doesn’t have a clothing retail presence. But maybe that’s next, given how quickly these two are matching each others’ moves.