I've read that canned salmon typically does not contain any preservatives.
On the other hand processed meat (such as ham) contains them.
Why are preservatives needed in some cases but not others?
These are two different ways to preserve food.
The canned salmon was
boiled and then sealed into a can while it was still boiling sealed into a can and boiled under a specified combination of time and temperature that has been empirically proven to kill enough bacteria. All the bacteria in the can are dead, and no more can get in, so it's sterile and won't rot until it's opened.
The ham is preserved differently: instead of being sterile, it has enough preservatives that whatever bacteria get in can't grow, or at least grow very slowly.
The difference is between canning and curing, not between fish and meat. It's also possible to can meat (in which case it doesn't need preservatives) and cure fish (for example, smoked salmon).
Canned salmon is sterilized. Sterilization uses heat to render a product safe. Cured hams are preserved with salt, and nitrites in some cases. Some hams are also cooked. Furthermore, some fish is salted and dried for curing purposes. Salt and drying greatly reduce water activity to render a product safe. Two different processes, both create a safe product.