Crude oil contains a number of impurities, including salt.
Much of this is removed at the well head. However, some is left behind and must be removed to stop it causing problems (like clogging up the heat exchangers).
The crude oil is mixed with water which dissolves the salt. The oil and water mixture is then separated using large charged plates. The salty water is pulled to the bottom and the cleaned oil floats on top.