Cavities are caused by acid erosion of tooth enamel. Many different types of bacteria normally live in the human mouth. They accumulate (along with saliva, food particles and other natural substances) on the surface of the teeth in a sticky film called plaque.
Plaque forms especially easily in cracks, pits or fissures in the back teeth; between teeth; around dental fillings or bridgework; and near the gum line. Some of the plaque bacteria convert sugar and carbohydrates (starches) in the foods we eat into acids. These acids dissolve minerals in the surface of the tooth, forming microscopic pits or erosions that get larger over time.