The quick answer is that “Like dissolves like”.
Why is this so?
Polar substances tend to dissolve in polar solvents, and nonpolar substances dissolve in nonpolar solvents.
When a dissolves in a the individual particles of the solute separate from their neighbours and move between the spaces of the solvent particles.
The solvent particles collide with the solute particles and the between solute and solvent particles “hold” the solute particles in the spaces.
There are three steps to the dissolving process:
The solvent particles must move apart to make room for solute particles. This process requires energy to overcome forces of attraction between solvent particles. This step is endothermic.
The solute particles must separate from their neighbours. This process also requires energy to overcome the forces of attraction between the solute particles. This step is endothermic.
When the solute particles move between the solvent particles, the between solute and solvent take hold and the particles “snap” back and move closer. This process releases energy. This final step is exothermic.
Consider the process of dissolving a crystal of salt (##”NaCl”##) in water.
A sodium crystal consists of an array of sodium ions (yellow) and chloride ions (green).
Water is a polar solvent: the ##”O”## end has a partial negative (##δ^-##) charge, and the ##”H”## ends have ##δ^+## charges.
When you put the salt in water, the ##δ^+## ends of the water molecules surround the ##”Cl”^-## ions from the ##”NaCl”##, and the ##δ^-## ends of the water surround the ##”Na”^+## ions of the ##”NaCl”##.
The ions become solvated (hydrated).
This is an energy-releasing process.
Then, the positive and negative ends of the ##”H”_2″O”## that are not surrounding the ##”NaCl”## ions attract each other, holding everything together in a three dimensional H- network.
The ##”NaCl”## dissolves because you get back more energy from hydration of the ##”Na”^+## and ##”Cl”^-## ions than it takes to remove the ions from the surface of the crystal.
What if you have a polar liquid such as ethanol, ##”C”_2″H”_5″OH”##?
Will it dissolve in water?
The molecules of ethanol are attracted to each other by H-bonding.
And the molecules of water are attracted to each other by H-bonding.
If you gently add ethanol to water, you may get two layers, in which the less dense ethanol is on the top.
At the interface between the layers, the ethanol molecules can H-bond to the water, and the water molecules can H-bond to the ethanol.
Because the attractions between the molecules are similar, the molecules can mix freely with each other.
Water and ethanol are miscible in all proportions.
All it takes is a gentle swirl, and we have a homogeneous mixture (a solution) of the two substances.
What if you have a nonpolar substance such as hexane?
Will it dissolve in water?
If we add hexane to water, the hexane will float on the top of the water with no apparent mixing.
The attractive forces among the hexane molecules are the relatively weak London dispersion forces.
The attractive forces among the water molecules are the relatively strong H-bonds.
The only attractive forces among the hexane and water molecules are London forces.
Thus, a few hexane molecules will enter the water layer, but the strong attractive forces among the water molecules keeps most of the hexane molecules out.
Similarly, a few water molecules will enter the hexane layer because of the water-hexane London forces.
Water and hexane are immiscible. They do not dissolve in each other.
Finally, will nonpolar substances such as hexane and pentane dissolve in each other?
The attractive forces among both the hexane and the pentane molecules are the relatively weak London dispersion forces.
There is little resistance to a molecule of one compound moving into the other layer.
When the nonpolar pentane molecules move into the nonpolar hexane, London forces are disrupted between the hexane molecules, but new London forces are formed between hexane and pentane molecules.
Because the molecules are so similar, the structure of the solution and the strengths of the attractions between the particles are very similar to the structure and attractions found in the separate liquids.
When these properties are not significantly different in the solution than in the separate liquids, it is largely the natural tendency of a system towards increased disorder (greater entropy) that drives them into solution.
Thus, polarity affects solubility.
If solute and solvent have approximately the same polarity, they will probably form a solution.
“Like dissolves like”: Polar solutes dissolve in polar solvents; nonpolar solutes dissolve in nonpolar solvents.