Here's the breakdown:
* Sodium (Na) is a metal and easily loses one electron to become a positively charged ion, sodium ion (Na+).
* Chlorine (Cl) is a nonmetal and readily gains one electron to become a negatively charged ion, chloride ion (Cl-).
These oppositely charged ions attract each other due to electrostatic forces, forming the ionic compound sodium chloride (NaCl), commonly known as table salt.