Grocery stores order large amounts of food, usually from centralized distributors. Packaged foods have expiration dates, and in most areas, the law prevents stores from selling expired foods. This is for consumer safety, to ensure that no one purchases food that has gone bad. Produce does not have an expiration date, but will begin to mold, rot, wilt, or look unsightly. As a general rule, grocery stores try to reduce the amount of leftover food that they end up with, since unsold food generates no money for the store. There are a number of techniques used to reduce expired food, and to dispose of it, but it is often donated, composted, or thrown out.
The stocking staff of a grocery store is also responsible for pulling expired or damaged foods from the shelves, and they keep an eye on upcoming expiration dates. Often, a grocery store will place food on sale before it expires, to encourage consumers to purchase it. Shoppers should be aware of this when purchasing sale food, and always check expiration dates. This may not be an issue for people who plan to use the food quickly, but for those who are purchasing sale food to eat later, this could be important.
If a grocery store suspects that it is going to end up with leftover food, it may donate products that are about to expire to charities. Food banks and homes for the elderly both benefit from donations of food that is perfectly safe, but was purchased in excess. Generally, a grocery store donates leftovers that have at least two weeks before they expire to ensure that they will be used in time.
When it comes to produce, a grocery store may donate edible but unsalable produce to charity or a zoo. Zoo animals often benefit from donations of usually expensive food items that are unsalable for one reason or another. Some grocery stores may donate produce items to animal farms, or sell the excess cheaply to farmers to feed their stock. Many grocery stores also get rid of bread and dairy products this way.
If produce starts to go bad, a grocery store may attempt to compost it. Many grocery stores have access to separate greenwaste collection so that they can compost produce, bread, and some other products. The leftover food is tossed into a large dumpster, which is periodically emptied and taken to a composting facility. Other food is thrown out, sometimes in locked dumpsters to prevent liability issues related to dumpster diving.