When I worked for a retail chain, one store did have a set up for a large customer, who would pay 10% of the value for any short dated items about to be tossed. He had a regular pickup date / time, so the employees could put it aside for him neatly the day before, and the proceeds went to the store's chosen charity (so employees were happy about it).
I think that he was from a Hutterite colony or something like that, and had a side business where he fed a lot of people as part of their work day. Only good quality, but close dated or items being switched off shelves to make room for new products were given, and cleanly packaged. Often, these were the items that could not get sold from the discount rack and were sold to him as a "last chance" money opportunity.
Anyway -- some of you larger volume dumpster divers may want to negotiate with a store if you have animals or a large need for regular supplies of food.
The chain I worked at, for most stores, had a recall / sort process, where instead of dumping items, they were sent to a central processing facility if non-perishable, and cleaned up, counted, and then the manufacturer was charged (for damage due to bad packaging), or sent to the discount location, or held for food bank pick up. Several large trucks a week went to the food bank. Note, this was partially paid by the drugstore (makeup / hair product) merchandise that the vendors paid the recall center to count and credit the stores for, as they did not trust store employees to do it correctly.