When you put it into water, the positive cations are attracted to the negative partial charges on the oxygen side of the water, and the negative anions are attracted to the positive sides of the hydrogen.