Good question Pete.
The twist in yarn is typically set with heat. Heat is an expensive commodity. In some poor quality carpet yarns, the heat setting is seriously lacking, and the yarn can untwist itself very easily, even from a prespray. Usually, wear and tear will have caused this to happen before we ever get near the carpet, but still worth being aware of it. The biggest problem is more likely to be if protecting a new carpet. The carpet spoils very quickly, so always test.
The twist can also be chemically set. The NCCA orgainised a tour of Axminster Carpet Mill some time back, and speaking to our guide, he told me that a chemically set yarn is the better method.
Safe and happy cleaning
Ken