You’re also allowed to order takeout and pick it up yourself if you don’t want to pay Grubhub prices
Now that prices are high and margins are tightened (blame practical downstream or “greedy corporations” or just MBAs, I don’t care) that subsidy isn’t bearable. So you pay for delivery.
The couple of dollars extra for delivery fees started maybe in the mid/late 2000s where I am (midwest USA).
Or not. Sometimes extra costs simply come out of the bottom line because it is better to make a delivery sale with lower margin, than lose the sale entirely.
The idea that it must be subsidized only makes sense if every pizza place has no profit.