Ionic compounds are made up of atoms that have gained or lost electrons to form ions, which are charged particles.
Opposite charges attract each other and these electrostatic forces of attraction (coulombic forces) are what hold the particles together in the crystal lattice structure.
By Coulomb's Law in Electrostatics, the magnitude of the electrostatic force
Furthermore, the direction of this electrostatic force is determined from the theory of electrostatics - like charges repel each other and unlike charges attract each other.
Now if we take an ionic compound example sodium chloride (NaCl) in which 1 atom has been reduced and gained electrons to form negative ions (
By the same principle, nearby NaCl particles are then also attracted abd eventually an entire crystal lattice is built up, and the intermolecular forces holding them together are precisely these coulombic forces of attraction.
Note - ionic bonds hold the individual atoms together, intermolecular forces hold the molecules together in a crystal lattice.