If the solid is ionic, then it will have stability due to the lattice formed with each ion surrounded by 6 counter ions imparting many inter-ionic bonds. The lattice energy is the energy supplied to tear apart the lattice in an endothermic process to allow solution formation. When the ions are solvated , each ion will be surrounded by solvent molecules which give many ion-dipole attractions. The resulting solvation energy is an exothermic process. Lattice E + Solvation E = Heat of Solution which could be positive or negative. Besides the energy factor, there is the natural tendency for randomness upon solution formation which means that "stability is maintained". The same argument applies for solid covalent compounds except for the absence of lattice E & its replacement by secondary attractive forces between the molecules in the solid state.