Why is the energy of surfactant molecules lower at the liquid/air interface than in the liquid bulk? In this question the accepted answer states that surfactants tend to concentrate at the interface because their energy is lower there than at the interface. Why is that? Is it related to their water solubility in some way? Is the reason the same for all types of surfactants, or are there different mechanisms?
 A: Whether a material will dissolve in a solute or not is a trade off between the Gibbs free energy of the pure material and the free energy of the material in solution. Dissolution is always entropically favoured but the enthalpy of solution is often positive since the interactions between the solute and the water molecules are often not as strong as the interactions between molecules in the pure material. It is these water-solute interactions that we loosely refer to as the energy of the molecule in the solution.
Water molecules have a large dipole moment and this interacts strongly with charged solutes. So for example common table salt is soluble in water since the strong interaction between the water molecules and the sodium and chloride ions partially makes up for the loss of the strong ionic attractions in the solid. By contrast paraffin wax is insoluble since water molecules can interact with non-polar hydrocarbons only by weak Van der Waals forces.
A typical surfactant exploits this by having some parts of the molecules polar while other parts are non-polar. For example the common surfactant sodium lauryl ether sulphate has a polar sulphate group attached to the end of a non-polar $\mathrm{C}_{12}$ alkane chain. So when you try to dissolve SLES in water you are effectively trying to dissolve a mixture of soluble sodium sulphate and insoluble dodecane. The result is that except at very low concentrations the surfactant does not dissolve in the usual sense. Instead it forms structures such as micelles or liquid crystal phases, where the $\mathrm C_{12}$ chains aggregate to form what is effectively a tiny drop of liquid dodecane.
But where we came in was to ask why the surfactant molecules selectively adsorb at the surface, and this is because the molecules orientate themselves at the surface with the polar sulphate groups pointing downwards into the solvent and the nonpolar $\mathrm C_{12}$ chains forming what is effectively a two dimensional dodecane liquid at the surface. If you imagine pulling a molecule away from the surface into the water, then you have to pull the $\mathrm C_{12}$ chain away from its neighbours, where it wants to be, and into contact with water molecules, where it doesn't want to be. The energy that I (rather loosely) referred to in my answer to the previous question is the enthalpy change associated with this process.
I used sodium lauryl ether sulphate in the discussion above because it's a very common surfactant used in shampoos and shower gels across the world. Most of us will have smeared SLES over our skin or hair at some point. However there are a vast range of surface active materials ranging from polymers to colloidal particles. This vast range makes any simple classification impossible, but they all share the property that some part of the molecule interacts strongly with water while some other part does not.
