The ionic bond isĀ the electrostatic force of attraction between a positively charged metal ion and a negatively charged non-metal ion. Metals form positive ions because they lose electrons to become stable
Think of forming an ionic compound as three steps (this is a simplification, as with all models):
(1) removing an electron from the metal;
(2) adding an electron to the nonmetal; and
(3) allowing the metal cation and nonmetal anion to come together