Supermarkets are no longer just places for consumers to do their food shopping in person. Supermarkets are testing and rolling out smart warehouses, which use robots to fill online orders and deliver them.

Albertsons, Kroger Co. (NYSE: KR), Stop & Shop and Walmart (NYSE: WMT) are building automated mini-warehouses and "dark stores" to make deliveries and prepare pickup orders. Mini-warehouses are usually attached to existing stores, and in most cases, "dark stores" are completely separate. Both formats are closed off to customers, and are mostly automated. They use the assistance of robots for speed, save on labor, and get orders out faster.

The rapid growth in e-commerce is making retailers open more fulfillment centers, which means faster delivery times and lower last-mile costs to both businesses and customers and that is driving M&A activity in the sector.

Only about 5 percent of U.S. shoppers buy their groceries online, but that number is expected to steadily rise. Inc.’s (Nasdaq: AMZN) $13.7 billion acquisition of Whole Foods in 2017 was a game changer by putting pressure on supermarkets to evolve and meet consumer demands for convenient options, such as home delivery.

Using people to manually pick, pack and deliver orders is expensive for grocers, who already have tight margins. In addition, manually fulfilling online orders can lead to crowded aisles and long lines, especially on weekends. To help reduce costs and clear up the aisles, companies are turning to technology, including robots.

Kroger is working with robotics firm Ocado to build up to 20 warehouses across the U.S., which Kroger calls “sheds.” According to the 2019 Mobile Robot Market Report from Interact Analysis, nearly 600,000 robots are expected to be used by companies by 2023 to help fulfill orders. Kroger bought a five stake in Ocado as part of its partnership.

“What's so exciting about Ocado is that their model to deliver to customers is significantly less costly than our existing model,” said Kroger CEO Rodney McMullen said during a recent earnings call.

But it is not just Kroger that is focused on expanding customer convenience. Walmart expects to have same day delivery available in about 1,600 out of its near 4,700 stores by the end of 2019, and online ordering available in approximately 3,100 of them. Groceries account for about 56 percent of Walmart’s U.S. sales. During Walmart's most recent quarter, online sales grew 41 percent, driven by pickups and deliveries.