For example, shopping at Whole Foods is inefficient. However, once Instacart has their own (automated) warehouses and can cut out the middleman supermarket, as well as real estate/cashiers/etc, it can potentially shift to being profitable. Add in self-driving cars, and they're set.
(Also, don't forget that for many stores, Instacart marks things up 10-20%. So they're making +$20 on a $150 order.)