What happened

Shares of restaurant delivery marketplace Grubhub (GRUB) jumped 44% in the first six months of the year, according to data from S&P Global Market Intelligence. A buyout offer from Uber (UBER -2.94%) and a subsequent agreement to sell itself to Just Eat Takeaway, the European food delivery giant, was the main reason for the surge.

The stock diverged from the S&P 500 in May after Uber made its offer. 

^SPX Chart

^SPX data by YCharts

So what

Grubhub limped into 2020 losing market share to rivals like DoorDash and Uber Eats. Its challenges were on display in its February earnings report when it posted revenue growth of 19% in the fourth quarter to $341.3 million, but its adjusted EBITDA fell by 37% to $26.7 million. Its guidance also called for profits to shrink in 2020 as well.  

The Grubhub app open on a smartphone.

Image source: Grubhub.

Grubhub shares then fell in March along with the rest of the market, although it became clear that the company was benefiting from the pandemic in some ways, as Americans turned toward restaurant delivery and takeout with dining rooms closed. However, Grubhub said in March it would spend as much as $100 million to help independent restaurants and then added in April that it would spend most of its second-quarter profits on driving business to it restaurant partners.

With the economic reopening under way in May, the stock surged on news that Uber was pursuing a takeover. The report wasn't a total surprise as the food delivery industry has seen a wave of consolidation in recent years, but the combination may not have passed regulatory muster. Grubhub also found a more appealing offer from Just Eat Takeaway, which agreed to buy it in June in all-cash deal that valued Grubhub at $7.3 billion at the time.

Now what

Selling itself to Just Eat Takeaway is the best move for Grubhub and its shareholders. The company has seen its once-dominant market share evaporate amid intense competition while profits have turned into losses. The company's strategy for regaining market share, including adding non-partnered restaurants, seems ill-advised and only likely to hurt the brand in the long run. What happens under the guidance of Just Eat Takeaway remains to be seen, but Grubhub shareholders should be happy to get out with 44% gains through the first half of 2020.