Here's why:
* Metals tend to lose electrons and become positively charged ions (cations).
* Nonmetals tend to gain electrons and become negatively charged ions (anions).
The strong electrostatic attraction between these oppositely charged ions forms a ionic bond, creating the ionic compound.
Examples of ionic compounds:
* Sodium chloride (NaCl) - Sodium (metal) and Chlorine (nonmetal)
* Magnesium oxide (MgO) - Magnesium (metal) and Oxygen (nonmetal)
* Calcium carbonate (CaCO3) - Calcium (metal) and Carbon and Oxygen (nonmetals)
* Potassium bromide (KBr) - Potassium (metal) and Bromine (nonmetal)
Let me know if you'd like to explore specific examples or want to delve deeper into the properties of ionic compounds!