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 opposite charges of the ions attract each other, forming a strong ionic bond.