Ionic bounds are formed due to the electrostatic attraction between oppositely charged ions in a chemical compound.
The atom that loses the electrons becomes a positively charged ion (cation), while the one that gains them becomes a negatively charged ion (anion).