During the formation of ionic compounds positive and negative ions are formed from neutral atoms and then these oppositely charged ions are held in crystal lattice.
So the necessary conditions for the formation of bond are:
(i) Formed between a metal and a nonmetal atom.
(ii) Low ionization potential and low electronegative value of first element.
(iii) High Electron affinity of 2nd element.
(iv) High Lattice energy of the compound formed.
Hence, the ionic bond is formed between Na and CI atoms.