Ionic bonds are formed as a result of a redox reaction.
Formation of cations: In which atoms of an element (metal) with low ionization energy give some electrons to reach stable electronic configuration.
Formation of anions: in which atoms of another element with high electron affinity accepts electrons to achieve a stable electronic configuration.
Example: NaCl, the sodium atoms loss electron forming Na⁺ and the chlorine atoms gain electron forming Cl⁻, then the ions are attracted to each other with 1:1 ration forming the ionic compound NaCl.
Na + Cl → Na⁺ + Cl⁻ → NaCl
What is the attractive force within the ionic bond?
The attractive force within the ionic bond is the electrostatic attraction between the positively charged ions (cations, Na⁺) and the negatively charged ions (anions, Cl⁻).