When an ionic compound is in a crystal lattice structure, the ions are held together by strong electrostatic forces of attraction between the positive and negative charges. However, when the crystal lattice is broken down, such as when an ionic compound dissolves in a solvent or melts, the individual ions become separated from each other and are free to move independently.
The reason the ions do not immediately re-attract each other after being separated is because the electrostatic forces of attraction between them are now counteracted by other factors. These factors include the thermal energy present in the system, which causes the ions to move randomly and distribute themselves throughout the solution or molten state, and the interactions with the surrounding solvent molecules (in the case of dissolution) or other ions (in the case of melting).
In a solvent, the individual ions become surrounded by solvent molecules, which can form hydration shells around the ions. These solvent molecules effectively shield the charges on the ions, reducing their ability to attract each other. The ions become solvated and are now dispersed throughout the solvent, rather than being tightly packed in a crystal lattice.
Similarly, in the molten state, the ions are free to move and interact with each other and the surrounding ions. The thermal energy disrupts the ordered arrangement of the crystal lattice, and the positive and negative ions are able to move independently. The thermal energy and the motion of the ions themselves prevent them from immediately re-attaching to each other.
It's important to note that while the ions do not attract each other as strongly as they did in the crystal lattice, there can still be some degree of attraction between them. These residual interactions can contribute to the behavior and properties of the dissolved or molten ionic compound.