Grubhub's (GRUB) stock recently popped after the American food delivery company agreed to merge with its European peer Just Eat Takeaway (JTKWY -3.84%), which itself was formed by a recent merger between the U.K.'s Just Eat and Netherlands-based Takeaway.

The all-stock deal, which values Grubhub at $7.3 billion, will exchange each Grubhub share for 0.671 shares of Just Eat, which implied a value of $75.15 per Grubhub share when the deal was announced.

Grubhub's mobile app.

Image source: Grubhub,

That's significantly higher than Uber's (UBER -3.48%) all-stock offer, which reportedly topped out in the mid-60s per share before the talks ended. Merging with Just Eats would also likely avoid the antitrust scrutiny of a combination of Grubhub and Uber Eats, which would have combined the second- and third-largest food delivery platforms in the U.S., respectively, after DoorDash.

The combined company, which processed 593 million orders globally for over 70 million customers last year, will become "one of the few profitable players in the space" and the largest food delivery company outside of China. But looking ahead, should Grubhub investors take profits now or stick around and claim their shares of Just Eat?

What will happen to Grubhub's investors?

Just Eat Takeaway and Grubhub expect the deal to close in the first quarter of 2021. When that happens, Grubhub investors will receive new ADR shares of the new company.

Grubhub's former investors will own 30% of the new company, which will be led by Just Eat Takeaway founder and CEO Jitse Groen. Grubhub CEO Matt Maloney will join the new company's management board and lead its North American businesses. Two of Grubhub's current directors will also join Just Eat Takeaway's supervisory board.

Will the combined company be stronger than Grubhub?

Grubhub's growth decelerated significantly in recent years as its rising expenses crushed its bottom-line growth. Its revenue and adjusted EBITDA rose 47% and 27%, respectively, in 2018. But in 2019, its revenue rose just 30% as its adjusted EBITDA fell 20%.

Grubhub for Restaurants.

Image source: Grubhub.

Grubhub attributed those declines to tougher competition from rivals like DoorDash, which surpassed it as America's top food delivery platform last year, and higher logistics and marketing costs. It also started running out of smaller players to acquire after 16 years of aggressive inorganic growth.

In the first quarter of 2020, Grubhub's revenue grew just 12% year-over-year as its adjusted EBITDA plunged 59%, with the COVID-19 crisis exacerbating its long-term challenges. In April and May, Grubhub's total orders rose 28% annually to 39 million, while its year-to-date orders -- throttled by COVID-19 -- grew just 11% to 86 million.

By comparison, Just Eat Takeaway's orders grew 41% to 96 million in April and May, as its year-to-date orders rose 23% to 208 million. All of Just Eat's core markets generated high double-digit growth in orders, with orders from its Canadian business -- which it will more closely integrate with Grubhub -- nearly doubling.

Unlike Uber Eats, which posted an adjusted EBITDA loss of $313 million last quarter, Grubhub and Just Eats remain profitable on an adjusted EBITDA basis. Grubhub finished 2019 with an adjusted EBITDA margin of 14%, compared to Just Eat's margin of 15.6%. The combined company's margin should improve as it increases its scale, eliminates redundancies, and boosts its market reach and pricing power.

Why I'm not selling my Grubhub shares (yet)

I own shares of Grubhub, but the stock will likely remain below my average purchase price even after it merges with Just Eat Takeaway.

However, the merger could solve several of Grubhub's biggest problems -- including its overwhelming dependence on the saturated U.S. market, its slowing growth, and rising expenses -- over the next few years. Therefore, I'm willing to stick with the combined company a bit longer and see if it fares better than the old Grubhub.