Before Deliveroo (and similar services) restaurants (in UK/Europe since you discuss London) did not offer delivery at all.
Handling the whole order (which these days means online/through an app) and delivery in-house is costly and restaurants use Deliveroo because it makes commercial sense.
Generally the issue is that, on the one hand I don't think that people are willing to pay much for delivery while, on the other hand, delivery is very low productivity and it's not viable to pay delivery drivers much for this.
As someone else commented 20-30% of an order is not crazy compared to the cost of serving on-premises. Moreover, Deliveroo can only charge this to restaurants if they have a deal with them.
Low productivity and cost pressures are also why "dark kitchens" are developing: They save on the cost of having a full-blown restaurant geared for on-premises service and they cut travel times for drivers (they can go to a single location and collect from multiple collocated kitchens).