How does a ionic bond form?

An atom, usually a metal, loses electrons and another atom, usually a non-metal, captures that/those electron(s). The atom losing an electron becomes + charged; the atom gaining electrons becomes - charged. The attraction of + ions to - ions is the ionic bond and that's what holds the ions together.