Here's a breakdown:
* Metals tend to lose electrons and form cations.
* Nonmetals tend to gain electrons and form anions.
Key elements that form ionic compounds:
* Metals: Groups 1 (alkali metals), 2 (alkaline earth metals), 3 (transition metals), and some elements from groups 13, 14, and 15.
* Nonmetals: Groups 16 (chalcogens) and 17 (halogens).
Examples:
* Sodium chloride (NaCl): Sodium (Na) is a metal in group 1, and chlorine (Cl) is a nonmetal in group 17. Sodium loses one electron to become a cation (Na+), while chlorine gains one electron to become an anion (Cl-). These oppositely charged ions attract, forming the ionic compound NaCl.
* Magnesium oxide (MgO): Magnesium (Mg) is a metal in group 2, and oxygen (O) is a nonmetal in group 16. Magnesium loses two electrons to become a cation (Mg2+), while oxygen gains two electrons to become an anion (O2-). These ions attract to form MgO.
Exceptions:
* Ammonium ion (NH4+) is a polyatomic cation formed by the combination of nitrogen and hydrogen.
* Hydroxide ion (OH-) is a polyatomic anion formed by the combination of oxygen and hydrogen.
In summary:
Ionic compounds are formed by the combination of elements that readily lose or gain electrons, resulting in the formation of positively and negatively charged ions that attract each other due to electrostatic forces.