Final answer:
Oxygen gains electrons due to its high electronegativity, while magnesium loses them to achieve stable electron configurations. The ionic bond in magnesium oxide forms through the electrostatic attraction between Mg2+ and O2- ions, as explained by Coulomb's law.
Step-by-step explanation:
Using Coulomb's law and electronegativity, we can explain why oxygen gains electrons while magnesium loses them. Coulomb's law indicates that opposite charges attract each other. Since oxygen has a higher electronegativity (3.44) compared to magnesium (1.31), it has a stronger attraction for electrons. This allows oxygen to gain two electrons to achieve a stable electron configuration with an octet in its valence shell, becoming O2-.
Magnesium, on the other hand, tends to lose its two valence electrons in order to achieve a stable noble gas electron configuration, resulting in a Mg2+ cation. As each magnesium atom loses two electrons, it is an electrical balance that the same number of electrons are gained by oxygen atoms. Thus, the ionic bond created between Mg2+ and O2- is due to the strong electrostatic attraction as explained by Coulomb's law.
When these oppositely charged ions come together to form magnesium oxide (MgO), they do so in a ratio that maintains electrical neutrality, which in this case is one Mg2+ to one O2-, forming a compound with a strong ionic bond.