An ionic bond is formed when one atom donates an electron to another atom, resulting in the formation of positively charged cations and negatively charged anions. This electrostatic attraction between the oppositely charged ions holds them together. For instance, in the formation of sodium chloride (NaCl), sodium (Na) loses an electron to become Na+, and chlorine (Cl) gains an electron to become Cl−.