Latex paints (emulsion paints British English, not to be confused with latex rubber) are an emulsion of polymer particles dispersed in water.  Macroemulsions in latex paint are inherently unstable and phase separate, so surfactants are added to lower interfacial tension and stabilize polymer particles to prevent demulsification.
Anionic surfactants such as sodium dodecyl sulfate are most commonly used for stabilizing emulsions because of their affinity for hydrogen bonding with the aqueous medium. Nonionic surfactants are rarely used alone due to their inferior efficiency in creating stable emulsions in comparison to anionic surfactants. Because of this, non-ionic surfactants are usually used in tandem with anionic surfactants and impart a second method of colloidal stabilization through steric interference of the van der Waals forces amid polymer and pigment particles. Latexes that require stability over large pH ranges use larger nonionic to anionic surfactant ratios. Cationic surfactants are least commonly used because of their high cost, inefficient emulsifying capability, and undesirable effects on initiator decomposition. High speed application, low temperature storage, shear stresses from pumping, and other extreme storage or application conditions can cause the failure of a surfactant to adequately stabilize a paint dispersion.
The thermodynamic explanation for demulsification is the gain in Gibbs Free Energy resulting from lowering the total area of high energy surface interactions.
The energy gained from demulsification is dependent on the total area of interface and the surface tension of that interface. Surfactants lower the surface tension (γ) and thus gibbs energy is gained from demulsification. This slows the process of demulsification and stabilizes the latex paint.
The size of the droplets of dispersed polymer in a latex paint can be modeled with the following equation:
The radius of a droplet in the emulsion is dependent on surfactant length, L, volume fraction of dispersed phase, φ, and volume fraction of surfactant, φ.