Geha explains it so simply:
"Bacteria live in your mouth all the time. Some of that bacteria form a sticky substance called plaque on the surface of the teeth. When you eat sugar, the bacteria in the plaque turn the sugar into acids that can dissolve the hard enamel that covers your teeth. That's how cavities start. If you don't eat much sugar, the bacteria can't produce as much of the acid that eats away at the enamel. "
Photo: Courtesy wikipedia
Subject source: www.gehadental.com