Solids are usually arranged in a crystal lattice, where the ions are held in place by electrostatic attraction. To dissolve a substance you have to break this lattice. This breaking usually requires energy, which can come from several sources like:
* entropy (meaning the resulting solution has a lower degree of order, is more 'chaotic' than the crystal structure; this usually releases energy!)
* the hydration/solubilisation of the ions (energy released by the solvent molecules arranging themselves around the ions)
* using thermal energy from the surrounding, this means spontanous cooling of the resulting solution
* and probably one or two more energies I don't remember
Depending on the energy budget, derived by simply adding all these energies (which can of course be negative!) mentioned above, dissolution of a compound might be exothermic (causing the solution to heat up; example would be NaOH), endothermic (solution cools down considerably; example NH4SCN), or pretty much neutral (e.g. NaCl). Some solid compounds simply have such a big lattice energy that the amount of energy produced by dissolution is insufficient to destroy the crystal lattice: they do not dissolve readily or only to a small extend (like Al2O3).
I hope that made some sense. Anyone feel free to correct me.
I'm not fat just horizontally disproportionate.