Pitting occurs because condensation is allowed to build up in the bore, and rust sets in.
Many folks believe that carbon and/or copper fouling cause rust and pitting, but I've contacted some pretty knowledgeable people on that matter and it's really not the fouling--it's the moisture build up.
Some have written that electrolysis can occur between the copper layer and the steel, causing steel molecules from the barrel to migrate to the copper under certain conditions. This seems to have been mere conjecture, not actual science, and appears to be wrong.
What you can find is (as was mentioned earlier) copper will slough off more heavily in a bore that is already pitted, then, when someone finally cleans out the copper with an aggressive ammonia based chemical... voila... we find pits under the copper. But the copper did not make those pits--if it did, you should expect to always find pits under coppered up barrels which have not been cleaned for years. But the truth is, you generally don't. So when you do find pits under the copper, it's guilt by association; not the copper's fault.
Of course another major cause of pitting is when someone shoots corrosive primer ammo and doesn't clean with hot, soapy water followed by a good oil.
If you'll keep a good solvent/lubricant in the bore such as Hoppes number 9, or Kroil works well... you'll never have a problem with rust.
Dan