In house delivery has existed for a lot of business for a long time. For instance, nearly every pizza store would do delivery themselves. Many still do. However those services didn't introduce a middleman between you, the store, and the driver who extracted money from all 3.
When you operate a delivery service for your restaurant, there's A lot of overhead. You have to strike a balance between paying deliverers their wages, and timely service for your customers. If you mismatch your number of deliverers to the business you have for the day, then you're either throwing away money, or making your customers wait a very long time for their food, which also may have knock-on effects in the kitchen, if you don't want the food to be cold, you might need to wait to start preparing it until your delivery guy is on the way back from his route. Outsourcing delivery to a delivery company seems like a win from restaurants, which is probably why so many have signed up for it.