Why do preserved foods not spoil?

The basic premise of preservation is that it creates a hostile environment for microorganisms. The same way you couldn't live in a vat of acid, or in an environment that's very hot or cold, most bacteria can't. The salt would kill the microorganism by osmosis. Our cells need a certain concentration of salt and the same thing is true of other organisms.

Plant and animal cells must stay in a very specific range of measurements to maintain homeostasis. These include pH, electrolyte (salt, etc.) content, etc. to survive. When salt or another eletrolyte is added, The salt can kill the microorganism by creating an unsuitable environment and/or water become unavailable to support microbial growth. Sometimes chemical agents are added that do not allow bacteria and other microbes to colonize and grow on the food - microbes like bacteria and fungus that break down the food causing the spoilage. There are bacteria and other microorganisms which live in a wide range of environments. Some tolerate oxygen and some do not. Some tolerate salt and some do not. The same for alkalinity, acidity, pressure, and many other conditions. In fact, there are some bacteria, mostly from the group Archea, which live in very harsh environments- salt lakes, deep in the ground under high pressure, in hot thermal vents beneath the sea, deep down in petroleum deposits, and other places normally considered inhospitable to life. Archea are being studied for their ability to clean up pollution (they can eat oil and other chemicals) and possibly produce cheap fuels and other products. The solutions to many serious problems may very well be solved with the use of modified Archea.

There are certain limits or parameters outside of which most or all microorganisms cannot remain active, however this is theoretical. There have been microorganisms such as Archea living in thermal vents, hot springs, salt lakes, and other extreme environments for ages and ages. Some microorganisms create "spores" which are like hard seeds, which can survive for many years under harsh conditions, waiting until conditions are right to germinate and become active again. One example of this is Bacillus Anthracis, the bacteria which causes Anthrax.