Most perishables (e.g. milk, yogurt, some juices) have expiry dating that assumes a specific storage condition (e.g. refrigeration) and a stability timeframe. Milk just cannot make it past that point, because it starts out with a small amount of bioburden or microbes. They grow to a meaningful amount at or near the expiry date. By meaningful, I mean that the amounts exceed what the FDA uses as criteria for food products, with respect to the four critical pathogens:
e. coli
salmonella
pseudomonas
staph. aureus
For nonperishables, you are basically dealing with things that have preservatives added that not only inhibit bacteria and yeast/molds, but also keep thing fresh.
BHA and BHT are antioxidants
The paraben family are preservatives, as are potassium sorbate, sodium benzoate, etc.
For non-perishables, the basic danger is that the food will not taste as good past its use by date. The other basic criteria that ANYONE can use is how much water something contains will likely mean how much bacteria and/or yeast &molds it can support. things with a low percentage of water, or more importantly, a low water activity DO NOT support microbial growth. Peanut butter, for example, will not spontaneously develop bacterial growth, bec. it has a low water activity. That does not mean that it could not have been adulterated during processing or manufacture. Bacteriostatic and Bacteriocidal are different. The recent peanut butter scare deals with completely unsanitary processing conditions. The peanut butter itself is not capable of 'killing' the salmonella, but salmonella growth would really not be supported on it.