Mg >> Electronic configuration= 2,8,2 Stable form>> 2,8 hence valency= +2 Cl>> Electronic configuration= 2,8,7 Stable form>> 2,8,8 hence valency= -1 Formation of MgCl2
Formation of magnesium ion by donating an electron
Mg(2,8) → Mg+2 + 2e-
Formation of chlorine ion by accepting an electron
Cl(2,8,7) + e- → Cl-
When 2 free chlorine atoms accept the electrons given by single magnesium ion the compound MgCl2 is formed.
The 2 electrons lost by a magnesium atom are gained by chlorine atoms to produce a magnesium ion and 2 chloride ions.