Here's why:
* Metals tend to lose electrons, becoming positively charged ions (cations).
* Nonmetals tend to gain electrons, becoming negatively charged ions (anions).
When a metal and a nonmetal interact, the metal atom gives up one or more electrons to the nonmetal atom. This transfer creates opposite charges on the atoms, which then attract each other electrostatically, forming the ionic bond.