Supermarkets and many restaurants donate to food banks and shelters. The stuff they actually throw out could be dangerous to eat.
I know I was on a rodeo committee and was not allowed to donate prepared BBQ to a shelter here [TX.] They want canned goods for The Food Bank, which we have a very extensive one for the country's 8th largest city.
I see people in our bldg have brought in boxes of stuff and pasta packs. I don't know what happens to that. They don't want perishables or any kind of penetrable packs. Homeless here know they can eat very well. I've even picked up tabs for one young black woman, alone but for a dog.