Everyone knows that sugar can cause cavities, but few know that other forms of carbohydrates are almost as deadly for teeth. Research (pdf file) shows that processed starch foods and sugar-laden products are nearly as bad for your teeth as pure sugar. This can include junk food like potato chips, and also supposedly "healthy foods" like bread or cereal. Of course, one of the biggest cavity-producers out there is soda, which is likened to battery acid by some.
I asked my dentist a few years ago what causes cavitites, and he gave me an interesting answer. He said to take a couple of crackers and chew them for about ten minutes, but don't swallow them. He said if you do this, the crackers will actually turn to sugar in your mouth. I haven't tried that experiment, but you get the idea. Starches are just more complex forms of sugar, and eventually they are broken down to sugar in the mouth.
Paleolithic carbohydrates - fruits, vegetables, and nuts - have been shown to reduce cavities. This is partly due to the increased fiber, but is also due to xylitol, a natural substance found in fruits and vegetables. Xylitol is now included in some sugar-free gums, and has been shown to decrease cavities. In fact, the U.S. Army has engaged in a campaign to promote xylitol use among its dentists and soldiers.