# Question #d1e12

Magnesium has 2 electrons in its outermost shell whereas Oxygen has 6. It is easier for Magnesium to lose 2 electrons than to gain 6 more to reach the octet state and similarly, it is easier for oxygen to gain 2 electrons instead of giving out 6. SO, the 2 electrons of Magnesium are transferred to the Oxygen due to which $M {g}^{2 +}$and ${O}^{2 -}$ are formed and this causes the two oppositely charged ions to combine forming ionic bonding.