By Katherine Riley, Heather Haddon and Julie Wernau

The largest U.S. food-delivery companies are in a nationwide fight for customers.

Until recently, DoorDash Inc., Grubhub Inc., Uber Technologies Inc.'s Eats division and Postmates Inc. had footholds in different cities and regions of the U.S., but expansion has sent them hunting on one another's turf, worsening the already tough economics of food delivery. Customers have been inundated with ads and have benefited from promotions intended to try to lure their business.

Amid competition, deals are in the works. Uber agreed to buy Postmates for about $2.65 billion in stock. Meanwhile, Europe's Just Eat Takeaway.com NV and Grubhub are headed toward a $7 billion tie-up after a breakdown in Uber's bid for Grubhub.

Just Eat's bid for Grubhub helps it compete with Uber's food-delivery division globally, but won't reduce competition in the U.S., said Grubhub chief executive Matt Maloney.

"I want to make sure the fight stays here in the U.S.," he said.

In New York City, a prime battle ground for restaurant delivery, the major services are spending heavily to try to dominate Manhattan while individual players such as Postmates have managed to muscle out competitors outside the island.

The same goes for Los Angeles, where certain neighborhoods are strongholds for Postmates despite intense competition in surrounding areas.

Restaurants in Chicago tend to use several delivery apps at once, allowing customers to ultimately decide which delivery company they prefer.

--Luis Santiago contributed to this article.

Write to Heather Haddon at heather.haddon@wsj.com and Julie Wernau at Julie.Wernau@wsj.com