Splatters occur during frying when evaporated moisture from the food mixes with the hot oil on the outside, prompting the oil to crack, bubble, and spray everywhere.
When sprinkled on the pan before frying, salt works as a moisture absorber, minimizing the amount of water that comes into contact with the oil and limiting that splattering.