How were they selling a dollar for 80 cents? The actual food is more expensive on grubhub than ordering through the restaurant, and then there are multiple fees on top of that.
Tons of marketing/advertising. The free GrubHub+ subscription through prime probably burned through a lot of cash. I doubt Amazon was paying them very much (if anything) to Grubhub. Then you have all of the corporate staff (around 3k based on google search) who are highly paid.
And the competition from UberEats and Doordash, who also are constantly promoting discounts, free orders, etc. so there's almost no way they can recoup actual costs let alone turn a profit.
But there is the cost of hosting, developers, drivers, etc.
And that's all cost that is not borne by the restaurant.
And there is a limit to how much people would pay to get something delivered. So they're probably pricing the delivery, etc less than they've actually paid.
We've seen this before and we'll see it again. There are lots of people who will pay for things below cost. Sometimes that cost comes down but a lot of the time it does not especially in relatively affluent countries. I don't have a personal driver or chef like I might have in some places. I do have some other house/yard services but very occasionally and I consider them luxuries.