MgCl2 dissolves in water because the individual ions in the solid (Mg2+ and Cl-) coordinate with the partial charges in the water molecules. The magnesium cations coordinate with the partially negatively charged oxygen atoms and the chlorine anions coordinate with the partially positively charged hydrogen atoms.