Here's the quick and dirty from an electrical standpoint. Different types of metal sandwiched together actually forms a weak electrical current. That is, a very small electrical charge flows from one metal to the other. This charge is one of the things that oxygen needs to form rust - which is the oxidation of the surfaces of the two touching metals. Salt can also play into the chemical equation, making oxidation even easier. In this case your valve stem and the cap are the two dissimilar metals.
You can combat this with non-conductive protection like paint or you can use a non-conductive metal like zinc or nickel. You can also use oil, which inhibits oxidation by not allowing air (oxygen) to come into contact with the metal surfaces.
I use chrome caps with rubber o-rings and have never had any rust problems. Chrome is the metal in Stainless Steel that provides most of the corrosion resistance. There's some nickel in there too.