Ordering takeout from a restaurant and then never actually getting around to picking it up sounds like a pretty boneheaded thing to do, but believe it or not it actually happens pretty regularly. Most restaurants will take a name and phone number down when the order is called in, but if the order is ready, nobody comes to claim it, and his or her phone goes to voicemail, does it get eaten by the staff or thrown out?
It depends on the restaurant, and the style of restaurant. Many pizza chains, for example, have a “shelf life” for pizza, according to this Quora answer, so if the customer doesn’t show up within a set period of time it’ll either be eaten by the staff or thrown out, depending on how hungry/new the staff is (if the customer shows up after that period of time it’ll be remade).
As for other restaurants, it depends on a whole host of variables, but keep in mind that most restaurants keep to-go food on a counter or in a slightly out of the way location where it can be forgotten about until someone comes to pick it up. Most places aren’t going to risk throwing out or eating food that somebody ordered, and honestly they’re probably not even thinking about it until it’s either claimed or the restaurant is about to close and they notice that it’s still there. By that point, if someone wants to eat dumplings that have been sitting out for four hours they’re probably allowed to, but the odds of anyone wanting to are pretty slim.