Anecdotal, but from what I’ve seen from the few stores I know about, they either have a donation program set up where somebody picks stuff up and takes elsewhere (probably homeless shelters and hospitals?) or managers let employees snatch stuff up before it gets to the trash can. Most employees are pretty fucking sick of the food after working there a few months, but neighbors and workers near the location always appreciate a bag full of free goodies once in a while.