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.