The two factors that explain the difference in solubilities of ionic solids in water are:
Lattice Energy: This is the energy required to separate the ions in an ionic solid. Ionic compounds with higher lattice energies require more energy to break their ionic bonds and dissolve in water. As a result, they tend to be less soluble in water. On the other hand, ionic compounds with lower lattice energies require less energy to dissolve in water and tend to be more soluble in water.
Hydration Energy: This is the energy released when ions are hydrated (surrounded by water molecules). When an ionic solid dissolves in water, the water molecules surround and stabilize the separated ions.