Though dissolution is typically considered a physical process, in actuality there is on a spectrum from leaning more towards a chemical change to purely physical. Dissolution of a salt in water, for example, could be argued as a chemical change, since the starting material is bound by ionic forces and the resulting solution inevitably contains coordinate covalent bonds (water bound to the metal ions in solution), which did not exist in the salt beforehand. On the other end is dissolution of a molecule (sugar, vanillin, etc.) where there is no real chemistry taking place. There is always heat exchange involved in this process. Regardless, intermolecular forces (the physical attraction between ions, e.g., Na+ and Cl- from table salt, or between molecules, e.g., sugar in water) play a part in every dissolution process. Materials’ boiling points are what they are because of intermolecular forces, after all something has to hold them, water or ethanol molecules for example, “together” or else everything would be a gas!
Regardless of where the system at hand falls on this spectrum, the following general process are involved:
heat transfer:
overcoming solute-solute intermolecular forces (absorbs heat)
overcoming solvent-solvent intermolecular forces (the molecules must part ways to make room for the solute!, absorbs heat)
solute-solvent intermolecular forces (may absorb or release heat)
Depending now how the above process shakes out, dissolving a solute in a solvent can result in a net absorption of heat (it gets cold) or a net release of heat (it gets hot).
In the case of vanillin in ethanol, there is a net absorption of heat from the surroundings, so it gets cold.
As a counterexample and to keep with molecule-molecule systems, when you mix water and DMSO (dimethyl sulfoxide), the solution gets VERY hot.
Advanced reading:
Since processes generally tend towards more stable, less energetic states by releasing heat, why would an endothermic process (absorbs heat) be spontaneous? Entropy.
This is what happens with the entropy of the dissolution process:
entropy (disorder):
change in solute entropy is always positive
change in solvent entropy can be positive or negative (in the case of dissolving salts, the attraction of solvent molecules to the dissolved ions actually decreases total solvent entropy because of ordering around said ions)
If you can quantify the heat change (enthalpy) and change in disorder (entropy), you can calculate whether any process is spontaneous by the Gibbs equation:
delta G = delta H – T*(delta S)
(delta means “change in”, or final minus initial)
H = enthalpy
T = temperature
S = entropy
G = Gibbs free energy
If delta G is negative, the process is spontaneous, if it’s positive it will not happen at that temperature.
If delta H is negative, heat is released (exothermic), which helps delta G be negative.
If delta S is positive (more entropy, ordisorder), the negative sign in the equation helps delta G be negative.
In general, spontaneous process tend to release heat and increase entropy.
BUT, if the entropy change is large enough, you can overcome an absorption of heat. (The T*(delta S) term is larger than the delta H term.)
Turns out, with all the considerations above, when you plug in the enthalpy and entropy numbers, delta G ends up negative and vanillin dissolves in ethanol all by itself, because of entropy, and the solution ends up cold.