What Causes Cavities in Teeth: Bacteria, Sugar, and More

Cavities form when bacteria in your mouth produce acid that dissolves tooth enamel. This process isn’t instant. It unfolds over weeks or months as repeated acid attacks gradually weaken the mineral structure of a tooth until a physical hole develops. About 21% of U.S. adults between 20 and 64 have at least one untreated cavity right now, making tooth decay one of the most common chronic conditions in the world.

How Bacteria Turn Food Into Acid

Your mouth contains hundreds of species of bacteria, but one in particular drives most cavities: Streptococcus mutans. This bacterium is unusually efficient at absorbing sugars through specialized transport systems on its surface. Once it pulls sugar inside, it ferments it and releases lactic acid as a byproduct. What makes S. mutans especially damaging is that it keeps producing acid even when conditions are already very acidic, continuing to function at a pH as low as 4.4. Most competing bacteria can’t survive those conditions, so S. mutans essentially takes over.

The acid doesn’t attack bare tooth. First, a thin protein film called the pellicle forms on your teeth within 30 to 90 minutes after cleaning. This film is made of salivary proteins that naturally stick to enamel’s mineral surface. Bacteria then latch onto those proteins and begin building a layered community known as plaque. Once plaque matures, the bacteria inside it are protected from saliva’s rinsing effect and can concentrate acid directly against the tooth surface.

What Happens Inside the Tooth

Enamel is the hardest substance in your body, but it has a chemical weakness. It’s made of a mineral crystal called hydroxyapatite, which begins to dissolve when the pH at the tooth surface drops below about 5.5. Each time you eat something sugary or starchy, plaque bacteria produce a burst of acid that pushes the local pH below that threshold. Calcium and phosphate ions leach out of the enamel’s crystal structure in a process called demineralization.

Between meals, saliva normally reverses this damage. It acts as a natural buffer, using bicarbonate, phosphate, and specialized peptides to neutralize acid and raise the pH back to safe levels. Saliva also carries dissolved calcium and phosphate that can redeposit into weakened enamel, essentially patching the microscopic damage. This back-and-forth between mineral loss and mineral repair happens all day long. A cavity forms when the balance tips toward loss, meaning acid attacks happen more often or last longer than your saliva can compensate for.

The earliest visible sign is a white spot lesion: a chalky, opaque patch on the tooth where minerals have been pulled from beneath an intact surface layer. White spots can appear in as little as four weeks under the right conditions. At this stage, the damage is still reversible. Fluoride treatments and improved hygiene can drive minerals back into the weakened area. But if calcium loss continues unchecked, the surface layer eventually collapses and a physical cavity forms, which can only be repaired with a filling.

Why Some Foods Are Worse Than Others

Not all carbohydrates cause equal damage. In controlled studies, sucrose (table sugar) is consistently the most cavity-promoting carbohydrate, followed by glucose, with starch ranking lowest. Sucrose is particularly problematic because S. mutans uses it to manufacture a sticky, water-insoluble glue that helps the bacterium cement itself to tooth surfaces and build thicker plaque.

Frequency matters as much as quantity. Sipping a sugary drink over two hours creates a nearly continuous acid bath, while drinking the same amount in five minutes produces a single acid spike that saliva can neutralize relatively quickly. Sticky foods like dried fruit, caramel, or gummy candy cling to tooth surfaces and extend the window of acid production. Acidic foods and drinks, such as citrus juice or soda, add a second threat by lowering mouth pH directly, even before bacteria get involved.

How Saliva Protects You

Saliva is your primary defense against cavities, and it does far more than rinse food away. It contains lysozyme, lactoferrin, and lactoperoxidase, all of which inhibit bacterial growth. It releases compounds like urea and sialin that break down into ammonia, actively raising pH after an acid attack. And it serves as a reservoir of the exact minerals your teeth need to repair early damage.

Anything that reduces saliva flow dramatically increases cavity risk. Dry mouth (xerostomia) is a side effect of more than 100 medications with strong or moderate evidence linking them to reduced saliva production. The most common culprits are drugs with anticholinergic effects: certain antidepressants, antihistamines, blood pressure medications, antiseizure drugs, decongestants, diuretics, muscle relaxants, and GLP-1 receptor agonists. People with chronic dry mouth often develop cavities in unusual locations, particularly at the gum line, on root surfaces, and even on the biting edges of front teeth, areas that are normally well-protected by saliva.

Root Decay Works Differently

When gums recede and expose the root of a tooth, decay can develop faster than it does on the crown. Root surfaces are covered in cementum, a material with lower mineral content and more organic material than enamel. This makes roots more vulnerable to acid, and cavities can progress more quickly once they start.

There’s an interesting twist, though. Because root surfaces have smaller mineral crystals, they absorb minerals from saliva very readily. Exposed roots that stay healthy often develop a hypermineralized outer layer that can actually be denser than the original unexposed tissue. The problem arises when plaque accumulates on these surfaces or when aggressive brushing or dental probing damages that protective layer, exposing the softer interior to bacterial acid. Root cavities are especially common in adults over 65, about 13% of whom have at least one untreated cavity.

What Fluoride Actually Does

Fluoride protects teeth through a straightforward chemical reaction. When fluoride ions contact enamel, they swap into the mineral crystal structure, replacing hydroxyl groups. The result is a modified crystal called fluorapatite, which is more stable and more resistant to acid dissolution than the original hydroxyapatite. This exchange happens primarily at the crystal surface, right where acid attacks occur.

Fluoride also promotes remineralization. When dissolved fluoride is present in saliva or plaque fluid, it helps calcium and phosphate ions precipitate back onto weakened enamel faster and in a more acid-resistant form. This is why regular, low-level fluoride exposure from toothpaste or fluoridated water is more effective than occasional high-dose treatments. It keeps the repair process running at an accelerated rate throughout the day.

Who Gets More Cavities and Why

Cavity risk isn’t evenly distributed. Children aged 6 to 8 have the highest rate of untreated decay in baby teeth, at nearly 18%. Among adolescents, about 10% have untreated cavities in permanent teeth. In adults 20 to 64, that number climbs to 21%. These patterns reflect a combination of diet, access to dental care, saliva function, and oral hygiene habits.

Beyond the obvious risk factors of sugar consumption and inconsistent brushing, several less recognized conditions increase vulnerability. Acid reflux brings stomach acid into the mouth, eroding enamel from the inside out. Mouth breathing during sleep dries out saliva. Radiation therapy to the head and neck can permanently damage salivary glands. And some people simply harbor more aggressive strains of S. mutans, or have enamel that formed with slightly less mineral density during childhood development.

The core equation is always the same: cavities happen when acid production outpaces your mouth’s ability to neutralize that acid and rebuild mineral. Everything that shifts that balance, whether it’s a second soda in the afternoon, a medication that dries your mouth, or skipping fluoride toothpaste, moves you closer to the tipping point.