Ionic bonding occurs between two oppositely charged ions that are attracted to one another due to electrostatic forces. To form the ions, an (metal) atom will lose valence(s) to form a full valence shell and become stable. The electron(s) lost will be gained by another (non-metal) atom for it to have a full valence shell and become stable. This forms the anion and cation which form the ionic bond and result in an ionic compound.