Walmart missed out on a Marc Lore company once, when Amazon swooped in to beat it to the purchase of Diapers.com’s parent company several years back.

The giant retailer may not let it happen again.

Walmart is in talks to acquire Jet.com, Lore’s new startup that has raised more than $800 million in financing in an attempt to build a new online megastore, according to a person familiar with the talks. It is not clear how far along they are. News of the talks was first reported by the Wall Street Journal, which said the tie-up could value Jet at as much as $3 billion.

A Walmart spokesman did not respond to a request for comment. A Jet spokesman declined to comment.

A $3 billion price tag would be a steep one for Walmart, considering that Jet is largely still unproven and burning more than $20 million a month on advertising alone. A deal would also certainly not be what Lore had in mind when he set out to build a legitimate competitor to Amazon, Walmart and others after his non-compete agreement with the Seattle-based retailer expired two years ago.

But it would be a marriage of necessity for both sides, and one that probably makes too much sense not to happen.

On the Walmart side, its e-commerce efforts have largely been viewed as a failure in recent years for a retailer of its size and power. Annual revenue for the division is around $14 billion, compared to $99 billion for Amazon, excluding Amazon’s AWS cloud computing unit.

Walmart’s e-commerce growth is also lower than the industry average and has been decelerating for more than a year. In the fall, the company said it would invest an additional $2 billion into those efforts to try to close the gap.

Five years ago, it would have seemed possible, but unlikely, that Walmart could catch up with Amazon. Today, that notion is laughable. Amazon accounts for half of all e-commerce growth today, by some estimates, and its North America retail business continues to grow more than 30 percent a year. Walmart recently unveiled a two-day shipping program to compete with Amazon’s highly successful Prime membership, but it seems several years too late even if it is half the price.

In Jet, Walmart would be acquiring the startup’s sophisticated pricing technology, which provides discounts to shoppers based on factors such as order size and proximity to partner warehouses. Shoppers typically save more as they add additional items to their virtual cart.

While Amazon’s success has largely been built around the convenience of its Amazon Prime membership program, Jet has been primarily focused on trying to beat everyone on price. It’s a strategy that won’t topple Amazon, but one that could make a dent with the help of Walmart’s existing pricing power and logistics network.

Walmart would also be acquiring a leadership team led by Lore that is widely viewed as having some of the best e-commerce operations minds in the business. Any deal would have to be done with the idea that Lore would stay on for several years.

Jet currently owns three warehouses and has relationships with more than 2,000 merchants that hawk their wares on Jet.com. Jet recently started selling bulk-size goods and fresh groceries, as well. The startup is on pace to sell more than $1 billion of goods through its site on an annualized basis, but is spending heavily to get there.

For Lore and Jet, the deal would be something of a shocker. Lore pocketed dozens of millions of dollars when he sold Diapers.com to Amazon so he doesn’t exactly need the money. That’s one of the reasons his backers believed him when he said his goal was to build a company worth tens of billions.

But the hurdles to get there have been significant from the start and perhaps even larger than Lore imagined. Jet only really works long-term as a standalone company if it can convince millions of people to order multiple items at a time to earn discounts; individual product prices aren’t typically better than its competitors.

Walmart has the money to help get the message out. Despite its e-commerce growth struggles, the entire company recorded a profit of nearly $15 billion last year. It could also potentially help Jet purchase inventory at cheaper prices because of its vendor relationships and the volumes it already buys.

If Lore decides to sell to Walmart now, it means it became clear to him that Jet would not be able to raise the billions it would need to fund its growth until it could reach the profitability he had projected several years down the line. Lore has often referred to Jet and its heavy spending as "just math" in the past. A sale likely means the equation he saw in front of him had changed.

Lore spoke about Jet's battle against Amazon on the Recode Decode podcast, last December: