Nitrites and nitrates are some of the oldest preservatives known, dating back at least to the middle ages.
Before refrigeration and canning, meat had to be either eaten right away or chemically preserved to keep it from spoiling. For several thousand years, salt was the only preservative known. Salt rubbed into meat killed microorganisms by drawing the water out of their cells.
During the middle ages the invention of gunpowder had the unlikely result of providing a new way of preserving meat.
It turned out that saltpeter, one of the main ingredients of the newly invented gunpowder, could keep meat from spoiling. So for a long time, saltpeter, or potassium nitrate, was mixed with salt and rubbed into meat before storing.
In time, scientists found that what preserved the meat was not the saltpeter itself, but a similar class of compounds called "nitrites," that are produced when the potassium nitrate molecule in saltpeter loses one of its oxygen atoms.
Today, meat is preserved by adding straight nitrites, including the most common meat preservative, sodium nitrite.
Put It In The Fridge!
With refrigeration, meat now lasts longer, making preservatives less often necessary.
Also, the switch from the wholesale application of saltpeter to carefully controlled doses of sodium nitrite means that meat can now be preserved with less nitrite than formerly.
In fact, preserved meat today probably contains only a small fraction of the nitrites found in meat two hundred years ago.