Our mouths are full of many different types of bacteria. Some harmful oral bacteria feed on the sugars in our diet, and turn this into acids that destroy the tooth enamel (the hard protective outer layer of the tooth).
Every time we eat or drink, these bacteria produce acids that demineralise (or dissolve) some of the tooth enamel. After we eat, our saliva washes away the acid, and minerals (such as calcium and phosphate) in the saliva help to remineralise (or re-build) the tooth enamel. Fluoride in toothpaste and water also helps to remineralise the enamel.
If we eat more sugar, or eat more frequently, the acid attack can demineralise the enamel faster than the saliva can help to repair it, and eventual a cavity is formed. Once this happens, the tooth can no longer repair itself, and the tooth will require a filling. If this is left for too long, the tooth may need root canal treatment, or even extraction.
Limiting your sugar intake is vital if you want to prevent tooth decay.
Recent research has shown that both the frequency and the amount of sugar is important in developing tooth decay. Dental researchers are now recommending that sugar should be no more than 5% of total energy intake to minimize the risk of tooth decay, and ideally should be as low as 3%.