When considering the question of how hair conditioner works you first need to know about the structure of hair. Hair, as you may know, is composed of a protein called keratin. This fact is important because keratin has a high percentage of those amino acids which have negative charges sticking out, like the hairs on a nettle.
The next thing you need to know is that most hair conditioners contain positively charged molecules called cationic1 surfactants. Soap, shampoo, and other cleaners contain surfactants (also called detergents) that are anionic2; that is, negatively charged. These cleaners are very effective at removing dirt, but they also remove natural oils and positive charges from the hair.
The positively charged surfactants in hair conditioner are attracted to the negative charges in your hair, and do not rinse out completely with water. When the hair dries, it is coated with a thin film, which adds weight, makes the hair easier to comb, and prevents static electricity from building up and 'frizzing' the hair.
Static buildup, by the way, is what happens when the positive charges are stripped from the hair. Rubber combs do this very nicely, which is why combing your hair on a dry day makes the hair 'frizz out'; because the negative charges on your hair are repelling each other!
All surfactants comprise an 'oily part' and a 'watery part'. The watery part - called the hydrophile - is what sticks to the hair; it contains the positive charge. The oily part - called the hydrophobe - is what gives the surfactant its conditioning ability, as it smooths the hair and gives it weight. The cationic surfactants used in conditioners come in several types, and can be classified by the nature of their hydrophobes.
If the hydrophobe has the structure of a saturated fat, like lard or butter, the surfactant has a waxy consistency. Oily hydrophobes, with a structure like liquid vegetable oil, give the surfactant a lighter texture; they may even be liquids. Hydrophobic polymers yield a hard, plastic-like material.
Hair conditioners come in several different types. 'Pack' conditioners are heavy and creamy in consistency. They contain high percentages of 'fatty' surfactants, and are used when the hair is damaged. Such conditioners are left in the hair for a long time, and will virtually 'glue' split ends and stripped scales into place. 'Leave-in' conditioners are lightweight, and will contain lighter-weight 'oily' surfactants, which add little weight to the hair. Ordinary conditioners have a balance between the two. There are also 'hold' conditioners; which are combination products that provide the benefits of conditioning while also holding the hair in place like a mousse. This effect is achieved using cationic polymers.
Finally, there are some conditioning ingredients which are not cationic. These do not offer the best results, but they have benefits of their own. Some anionic surfactants, which carry no electric charge, will stick to the hair in useful quantities. Unlike cationic surfactants, they can be mixed with anionic surfactants to produce conditioning shampoos. Other ingredients, like esters, oils, and polymers, are added to improve lustre, add comb-ability, and assure that the conditioning ingredients stay mixed in the bottle.