Ionic bonds form when one atom losses an electron (or electrons)
to achieve a noble gas configuration, and another losses an
electron (or electrons) to achieve a noble gas configuration.
Sodium, shown below, has one electron, that it would
like to give away.
Chlorine, shown below, could use one more electron in order
to achieve nobel gas configuration.