When meat is fully cured, it won’t go bad if it is left exposed to air and in a relatively cool place. To cure meat to this degree takes prolonged contact with salt, brine, and/or sugar, all of which resist bacteria. Since most bacteria need water to live, drying also helps preserve meat, which is why salted or brined hams are hung up to a year or even longer. Smoking can also help cure a ham, because smoke contains compounds that kill bacteria.
Sometimes curing techniques are used