I think this is caused by oxidation of the resistive material, and possible corrosion of the contacts. It's true that turning the knob back and forth rapidly a few dozen times can help, but not nearly as much as contact cleaner. I had a volume control on an old black and white TV that did that, and I fixed it by opening it up and spraying the potentiometer behind the knob liberally with that stuff, then turning it back and forth many times while still wet, and it was almost like new afterward.
To be on the safe side, one should make sure to disconnent any power sources beforehand, and make sure it's dried thoroughly before trying to use the device in question again. (And in the case of TVs, it's best to not even attempt it unless you know what you're doing, due to the possibility of residual high voltage.)
Disclaimer: If you screw up your device, or set your hands on fire, it's your own fault, not mine. You have been warned.
