The shelf life of a particular food is very important because it helps stores to know how much they should order at any given time. They can track the sales and then attempt to purchase as much as they can sell by the time that the food expires.
It is critical to find out what this amount is, because ordering too much food means that it will have to be thrown away before it has a chance to sell and ordering too little means that the store is missing out on sales that it could have made. This is why food processing software is used, along with inventory checks, to keep an eye on the expiration dates.
Of course, this is not a perfect science, mostly because you cannot always predict what people are going to purchase. There could be more interest in a specific food one week than there is the next. This may have to do with a holiday or some other event that only happens from time to time.
For example, people buy egg nog around Christmas, but they do not really buy it at any other time of year. Stores have to take this type of thing into account as well.
Stores must watch the expiration dates to keep up with customer demand, but they also have to consider the regulations put out by government organizations. Selling food that has gone past the expiration date, even if it is still good, can result in fines and penalties.