DoorDash came along (after Postmates btw) and offered the same marketplace, but with delivery drivers too (a three-sided marketplace) - so that a restaurant didn't need to employ delivery drivers. This meant a higher cost base for DoorDash, lower for the restaurant, but similar commission fees. The simplicity of offering online marketplace ordering and delivery was very enticing for restaurants not wishing to manage this themselves, hence DoorDash's huge rise in market share, at the cost of Grubhub's over the last 2 years.
Grubhub has now for the past 3 years been busy spinning up delivery in its markets but is way behind DoorDash and Uber Eats. They have also admitted to falling behind in their Q3 2019 announcement[1] to the new competition (their late admission caused their stock to drop 43% in 1 day on the earnings announcement), and started also spinning up the non-partner side of the marketplace (adding restaurants without an agreement in place) to give customers more to order from (this is what Postmates then DoorDash pioneered). This is why they've started hemorrhaging cash and became loss making.
[1] https://s2.q4cdn.com/772508021/files/doc_financials/2019/q3/...