Salt removes most of the bacteria from their internal water and destroys them. The osmosis causes the bacteria to drain the internal water, keeping the salt concentration inside and outside the cell membrane balanced. If there is no water, the bacterial protein such as enzymes will not work and eventually disintegrate.
But some Staphylococcus, which are prone to infection, sepsis, and even death, are halogen-tolerant bacteria that can tolerate salt.
These pathogens have a salt alertness system that uses sponge-like molecules to prevent water loss.