The ionic bonds can take place when the cation and the anion have equal charge but in magnitude, but opposite in nature.
Step-by-step explanation:
An ionic bond is the bond where the positively charged ions or cations and negatively charged ions or anions are attracted together by means of electrostatic force of attraction which leads to the formation of the ionic molecule. Its not a true molecule, there's no sharing of electrons between the ions.
This type of bonds take place between the atoms of elements which has a very high difference in electronegativity. This leads to pulling out of electron by more electronegative atom to form the anion from the electropositive atom which forms the cation. Now if the electronegative atom pulls out one electron from each cation, then they will have unit charge each, which will be opposite in nature.