It is very true that eating bulk candy leaves behind a lot of sugar in our teeth. And the good old bacteria eat the remnants of sugars and produce acids right in our teeth. These acids are produced by bacteria on breaking the sugars in a process called glycolysis. In this process the bacteria produces energy for themselves and acids which help our teeth decay!!.
Well, that's not it - there is always another problem. It is to do with those bacteria. It can store these sugars found in our tooth for later use, so they can produce the acid any time they'd like to. Well, the answer to this is simple, brush your teeth twice a day at least 2 min per brush with a fluoride containing paste. Now this is very important as it is a good idea to ask the dentist for brushing instructions, believe me its more complicated than it seems. Also floss daily and use a daily mouth rinse if possible.
If you do all these things consistently every day and go to the dentist for a check up once in 6 months or so, the chance that you will have a cavity is largely reduced. Talking about the body, this depends greatly on the amount eaten, your metabolism and amount of exercise you do regularly. I hope all this information was helpful - I had taken my wife over to the dentist last evening for a Root Canal treatment and had a casual chat with the dentist and the conversation opened up all this information.
Also, one more thing which I forgot to mention - when I mentioned sugars I meant white sugar(sucrose), fructose and similar ones. There are other sugars which are helpful for the teeth such as xylitol. So chewing gum with xylitol is great for the teeth, it mechanically cleans the teeth and provokes saliva secretion which reduces the acidity in the mouth!!