Here's why:
* Ionic bonds occur when one atom (in this case, sodium) loses an electron to become positively charged, and another atom (chlorine) gains that electron to become negatively charged.
* The opposite charges of the ions then attract each other strongly, forming a stable compound (in this case, sodium chloride, NaCl).
Let me know if you'd like more details about ionic bonds!