Why do things dissolve
Probably everyone wondered at least once, why does sugar dissolve in tea. Here we will not focus on sugar as such but basically on a problem - why some things dissolve and some do not?
In process of dissolving, molecules of the solute are inserted into a solvent and surrounded by its molecules. In order for the process to take place, molecular bonds between molecules of solute (ie. sugar) have to be broken and molecular bonds of the solvent also have to be disrupted. Both of these require energy.
Example of sugar
When sugar dissolves in water, new bonds between sugar and water are created. During this process energy is given off. The amount of this energy is sufficient to brake bonds between molecules of sugar and between molecules of water. This example is relevant to any solute and solvent. If the bonds between solvent or solute are to strong and there is not enough energy provided while dissolving to brake them, the solute will not dissolve.
Example of salt (Ionic compounds)
The same energy rule can be applied to salts. They are build of positive and negative ions which are bound together by the force of attraction of their opposite charges. If energy needed to brake their ionic bounds is lower then the energy given off by an interaction of the ions with solvent (ie. water), the salts will dissociate and interact with solvent and thus dissolve.