* Sodium (Na) is a metal, and metals tend to lose electrons to achieve a stable electron configuration.
* Chlorine (Cl) is a nonmetal, and nonmetals tend to gain electrons to achieve a stable configuration.
Sodium loses one electron to become a positively charged ion (Na+), while chlorine gains one electron to become a negatively charged ion (Cl-). These oppositely charged ions attract each other, forming the ionic compound sodium chloride.