In a word, hypertonicity. The salt has such a high osmolar index (ability to suck water from anything it comes in contact with), that any bacteria, viruses, or fungi cannot live in it. The salt simply sucks all the water that's in their cells out, thus killing them. No bacteria/fungi/viruses, no spoilage. It's that simple.