Watch what happens when a leech touches salt. In this disturbing video, we see osmosis as a result of salt exposure, which can be fatal.
Salt creates a hypertonic environment, drawing water out of the leech's body. This causes the leech to dehydrate and can lead to its death. The salt disrupts the leech's bodily functions, making it unable to survive in that environment. This is why salt is often used as a natural way to deter leeches.
Some people use salt as a way to remove a leech from their body after it has started sucking their blood. I've had a leech stuck in my foot before, and wish I would have known about this method. I would also feel immensely creeped out to see a leech squirming around while on me, the way it does in this video. My personal leech removal method involved screaming and waving my foot around in the air until someone came and helped me.
See also: Nose-dwelling leech