* Metals tend to lose electrons and form positively charged ions (cations).
* Nonmetals tend to gain electrons and form negatively charged ions (anions).
The opposite charges of the ions attract each other, creating a strong electrostatic bond that holds the compound together.
For example:
* Sodium (Na), a metal, loses one electron to form a sodium ion (Na+).
* Chlorine (Cl), a nonmetal, gains one electron to form a chloride ion (Cl-).
These ions then combine to form the ionic compound sodium chloride (NaCl), also known as table salt.