Sometimes a business transaction works out well for both side of the deal. That's clearly how the market see the recent agreement between Grubhub (NYSE:GRUB) and Yelp (NYSE:YELP).

What happened?

The two companies had been competing in the food-delivery space. They agreed to stop doing that with Grubhub acquiring Yelp's EAT24 service, while Yelp agreed to integrate online ordering from Grubhub into its platform.

The deal saves Yelp the cost of running Eat24 while bringing it revenue from any orders it generates for Grubhub on its platform. Conversely, Grubhub gets rid of a major competitor while getting access to its user base.

"Adding Eat24's large diner base and thousands of restaurants to our platform will accelerate Grubhub's mission to become the most comprehensive marketplace connecting takeout diners and restaurants," said Grubhub CEO Matt Maloney in a press release.

A person holds up a phone with a button that says "order"

Grubhub will take over Yelp's Eat24 delivery service. Image source: Getty Images.

So what

Investors clearly liked seeing these two companies partner up. After closing July at $46.13, Grubhub shares finished August at $57.09, a nearly 24% gain, according to data provided by S&P Global Market Intelligence. The same source showed that Yelp closed July at $32.53 and finished out August at 42.60, a 31% increase.

Now what

Both companies have one less headache in that they won't be competing with each other. That should make it easier for the two brands to compete with giants including Amazon and Uber, which have designs on the food delivery space. In addition, both companies face competition from a number of individual brands that have committed to delivery -- some using third-party services and others doing it on their own.

This deal lets both companies play to their strengths. Grubhub gets to deliver food, and Yelp can offer that service as part of its review platform. That helps each company conserve capital for the bigger battles both face.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.