Cetrimonium bromide is an ammonium salt used in hair and skincare products. It prevents static build-up that causes flyaway hair.
It is also an emulsifier and a surface-active agent (surfactant). All surfactants are partly water-soluble and partly oil-soluble. It is this quality that allows oil and water to mix.
When used in cosmetic products, the surfactant molecules become organised in a structure that can trap oil-based dirt. This allows the oil and dirt trapped in it to be rinsed away cleaning the hair, it also helps the hair to lie flat and gives it a silky shine.