Ionic Bond
Types of Bonds can be predicted by calculating the difference in electronegativity.
If, Electronegativity difference is,
Less than 0.4 then it is Non Polar Covalent Bonding
Between 0.4 and 1.7 then it is Polar Covalent Bonding
Greater than 1.7 then it is Ionic Bonding
For Mg and Cl,
E.N of Chlorine = 3.16
E.N of Magnesium = 1.31
________
E.N Difference 1.85 (Ionic Bond)
MgCl₂ being ionic in nature when dissolved in water dissociates into Magnesium and Chloride ions respectively.