* Metallic bonds occur between metal atoms. They involve the sharing of delocalized electrons in a "sea" of electrons that surrounds the positively charged metal ions.
* Magnesium (Mg) is a metal, but chlorine (Cl) is a nonmetal.
* Nonmetals tend to gain electrons to form negatively charged ions (anions).
* Metals tend to lose electrons to form positively charged ions (cations).
Therefore, when magnesium and chlorine react, they will form an ionic bond. Magnesium will lose two electrons to become a +2 cation (Mg²⁺), and chlorine will gain one electron to become a -1 anion (Cl⁻). These oppositely charged ions will then attract each other, forming an ionic compound, magnesium chloride (MgCl₂).