Like mall-based retailers did in the 1990s, supermarkets have been expanding rapidly across the US in recent years.

"Over the past 10 years, we saw high growth from some of the more traditional players, which has resulted in saturation in the US, and forced mainstream supermarkets to slow openings," Danielle Dolinsky, an analyst at retail consulting firm Planet Retail RNG, told Business Insider.

For some companies, however, the pace of growth is only accelerating.

Discount grocers including Aldi, Lidl, and Dollar General are collectively planning to open thousands of new stores over the next couple years.

At the same time, tech companies like Amazon — with its recent acquisition of Whole Foods — are also entering the food wars.

Competition is ramping up at a time when the amount of retail space devoted to food sales in the US has already hit a record high.

The US has 4.15 square feet of retail food space per person, which is nearly 30 times higher than in 1950, according to CoStar Group data cited by the Wall Street Journal.

But demand hasn't kept up with unit growth.

Total US grocery sales fell nearly 2% in the 12-week period ending July 15, compared to last year, according to Nielsen data. The US food retail market is highly fragmented. UBS

Grocery stores have been slashing prices to drive sales and better compete, which is driving profits lower in a business that's already pressured by razor-thin margins.

Whole Foods' same-store sales have been falling for the last two years. Even long-dominant companies like Kroger, the largest supermarket chain in the US, are taking a hit.

Kroger's impressive 13-year streak of quarterly same-store sales increases ended earlier this year. That metric has now dropped for the last two consecutive quarters.

A 2014 price study found that Aldi's prices were about 22% cheaper than Kroger's. Aldi has more than 1,600 stores in the US with plans to open another 600 within the next couple of years.

The German grocery chain Lidl is planning a massive expansion in the US. Business Insider/Hayley Peterson Walmart is also investing in its grocery department. The company has been expanding its click-and-collect program that allows customers to order groceries online, then pick them up at stores. Walmart also reduced prices on hundreds of grocery products last year and recently launched a grocery price-comparison test in 1,200 stores in an effort to edge out Aldi.

Dollar General is opening 1,000 stores this year. Business Insider/Hayley Peterson Grocers near the new Lidl stores have already started dropping prices to better compete, according to a recent price check by Jefferies analysts in several Southeastern markets.

The Dollar General store in Roebuck, South Carolina dropped prices by 10% to 30% in response to Lidl entering the market, analysts said. Food Lion has also cut prices in markets where it competes directly with Lidl. The company sent executives to Lidl's stores in other countries ahead of its US launch to better understand the concept.

History is repeating itself

Department stores and many mall-based retailers started engaging in a similarly aggressive price war during the recession following years of over-expansion, and most never recovered. Shoppers grew accustomed to the constant discounts and stopped shopping full-price. Now, these retailers are closing stores, shedding jobs, and filing for bankruptcy at staggering rates.

Grocery stores could be heading down the same path. But they have one major advantage over department stores: e-commerce is less of a threat.

Shoppers have been slow to migrate online for their grocery shopping needs. Food accounts for less than 1% of total online sales in the US, according to a recent Goldman Sachs report.

The supermarkets that survive and thrive over the next decade will have to find ways to shave operating costs — primarily through the use of smart technology that strengthens inventory management and robots that improve the customer experience — and funnel those savings into ongoing price cuts.

Companies like Kroger and Walmart are already investing in these technologies. But many others are "unwilling, or unable, to engage," Goldman Sachs analysts wrote in a research note published Wednesday.

It's not yet clear who the winners will be as the grocery wars shake out, but there's little doubt that consumers will benefit as chains are forced to continue dropping prices and offer more convenient shopping services to compete.