Since most foods are organic, immediately upon their being removed from their vine, plant or tree, they begin to spoil. We do eat non-organic substances, like salt and other minerals, but almost all our nutrition comes from organic substances. Since ancient times, humans have developed a multitude of ways to preserve organic food substances beyond their normal period of spoilage. Many of these methods come immediately to mind; drying, salting, pickling, freezing, canning and adding preservatives. Even if these methods of preservation are employed, organic foods still have a shelf life or time until they become either unpalatable or even dangerous to eat.
There is a detailed analysis of shelf life with a chart showing the Recommended Food Storage times for many foods at the Virginia Cooperative Extension. (Click on the words to go to the site).
To avoid waste, rotate your stored foods on a regular basis. If you put them on shelves, make sure newer purchases are put in the back and the older items come to the front. If you find that items stay on your shelves for more than the recommended time of storage, don't buy those products. Use what you store and store what you use.