Ionic bonding occurs when electrons transfer between atoms, with a concurrent formation of ions. The electrostatic attraction between newly formed cations and anions is the heart of the ionic bond.
By losing and gaining electrons, both the sodium atom and the chlorine atom acquire stability by achieving an octet of valence electrons. An octet of electrons is eight electrons, the number found in the outermost level of the low‐atomic‐weight noble gases. Through the loss of an electron, sodium becomes isoelectronic (having the same number and configuration of electrons) with the inert gas neon. By gaining an electron, the chlorine atom becomes isoelectronic with the inert gas argon. Ionic bonds form mainly between atoms of groups IA and IIA and atoms of groups VIA and VIIA of the periodic table.