Answer is: transfer of electrons.
Ionic bond is the electrostatic attraction between oppositely charged ions.
For example, compound magnesium chloride (MgCl₂) has ionic bond.
Magnesium (Mg) transfers two electrons, became positive cation, to chlorine (Cl), which became negative anion.
Magnesium is metal from group 2 and chlorine is nonmetal from group 17 of the Periodic table.