Answer:
For example, when magnesium reacts with oxygen to form magnesium oxide, the magnesium atom loses two electrons to form the Mg2+ cation, which has electronic configuration 2,8. The oxygen atom gains these electrons to form the O2– anion, with electronic configuration 2,8.