A mouth that is happy, relaxed and softly chewing the bit, usually produces some moisture. The salivary glands behind the jaw are massaged by the soft chewing motion of the jaw. When the spit runs down the insides of the mouth and moves with the tongue and lips, it foams slightly and produces what you may call a "white lipstick".
Horses that do not produce this, are either unhappy with their bits, not through in the poll (which comes from over the back and behind). They might be tense because of poor balance or because the rider is rought with the reins, or simply because they are slopping around and not working right. You quite often see that in riding school environments, on poorly ridden ponies, on horses that are only hacked, or possibly forcedly ridden horses with harsh bits.
Too much foam....In the top of the sport you hardly ever see dry mouths. But not all wet mouths are good. I would say most of the top GP horses one sees foam simply too much. This is not a sign that they are extremely relaxed and active behind, but rather that they are overly active in the mouth. If the horse is ridden overbent at the poll, so that the salivary glands are squeezed, and the rider pulls hard or fiddles constantly at the mouth, like sawing, the horse will defend himself. This is usually done by trying to get the tongue to move about and get the bits off, and it results in the tongue beating the saliva to a lather. If the horse opens his mouth in resistance, it can go to the extreme that blotches and strings of drool splatter the frontlegs or the chest. This is a sign of tension, and just like the stiffly lifted tail above, should not be sought or condoned.