What Really Causes Cavities

Cavities are not caused by sugar directly. They’re caused by acid, produced by bacteria in your mouth that feed on sugar and other carbohydrates. The real story is a chemical tug-of-war between acid dissolving your tooth enamel and saliva trying to repair it. When acid wins too often, you get a cavity.

How Bacteria Turn Sugar Into Acid

Your mouth is home to hundreds of bacterial species, and many of them form a sticky film on your teeth called plaque. This film is technically a biofilm: a structured community of bacteria embedded in a protective matrix of sugary polymers. That matrix is what makes plaque stubborn. It physically shields the bacteria underneath from saliva, which would otherwise wash them away or neutralize their acid output.

When you eat carbohydrates, bacteria in the plaque ferment them and produce lactic acid as a waste product. One species in particular, Streptococcus mutans, is remarkably efficient at this. It can keep churning out lactic acid even as the environment around it becomes increasingly acidic, a trait that makes it one of the most cavity-causing organisms in the mouth. As sugar levels rise, the bacterial community shifts from producing a mix of acids to producing almost entirely lactic acid, which is especially damaging to enamel.

The biofilm makes this worse by trapping that acid right against the tooth surface. Saliva can’t easily penetrate the sticky matrix to neutralize or dilute it. So the acid sits there, concentrated, eating into enamel far more effectively than it would on a clean tooth surface. This is why brushing and flossing matter: they physically disrupt the biofilm, not just remove food particles.

What Acid Actually Does to Your Teeth

Tooth enamel is made of a crystalline mineral called hydroxyapatite, which is primarily calcium and phosphate packed into a tight structure. When lactic acid lowers the pH at the tooth surface, it begins pulling calcium ions out of the enamel first, followed by phosphate. This process is called demineralization. It’s not dramatic or visible at first. It starts as microscopic weakening of the crystal structure, long before you’d see or feel anything.

The key number is the “critical pH,” the point at which enamel starts dissolving. This isn’t a fixed value. For most people it falls between 5.5 and 6.5, depending on how much calcium and phosphate is naturally present in their saliva. People with mineral-rich saliva can tolerate slightly more acidity before damage begins. Inside a thick layer of plaque, where calcium and phosphate concentrations are higher, the critical pH can be as low as 5.1. But that advantage is offset by the fact that plaque also traps the very acid causing the problem.

Your Saliva Fights Back

Saliva is your mouth’s primary defense system, and it does far more than keep things moist. It’s about 98% water, but the remaining 2% carries an arsenal of protective compounds. Bicarbonate, phosphate, and specialized proteins act as chemical buffers that neutralize acid. Saliva also serves as a reservoir of dissolved calcium and phosphate ions, which can redeposit into weakened enamel and rebuild it. This repair process, remineralization, is how your teeth recover from everyday acid attacks.

On top of that, saliva contains antimicrobial agents like lysozyme, lactoferrin, and lactoperoxidase that inhibit bacterial attachment and growth. It physically rinses food debris and loose bacteria off tooth surfaces. In short, saliva is running constant damage control.

This is why dry mouth is so dangerous for teeth. People with chronic dry mouth (from medications, medical conditions, or radiation therapy) have roughly three times the odds of developing root cavities and nearly three times the odds of cavities on tooth surfaces compared to people with normal saliva flow. Without adequate saliva, the acid lingers, minerals aren’t replenished, and bacteria thrive unchecked.

Why Frequency Matters More Than Amount

Every time you eat or drink something containing fermentable carbohydrates, the pH in your mouth drops rapidly within minutes. If it drops below the critical threshold, enamel begins dissolving. It then takes 30 to 60 minutes for saliva to gradually bring the pH back to a safe, neutral level. This cycle is called the Stephan curve, and understanding it changes how you think about snacking.

A landmark study conducted in Vipeholm, Sweden found that cavity formation was influenced more by how often people consumed sugar than by the total amount they ate. Someone who sips a sugary drink over three hours subjects their teeth to a nearly continuous acid bath, while someone who drinks the same amount in five minutes gives their saliva a chance to recover. The same logic applies to snacking on crackers, dried fruit, or candy throughout the day versus eating them at mealtimes.

Not All Carbohydrates Are Equal

Sucrose (table sugar) is consistently the most cavity-causing dietary carbohydrate. It’s worse than glucose, fructose, or mixtures of the two, partly because oral bacteria can use sucrose to build the sticky polysaccharide matrix that holds plaque together. In a clinical trial at the University of Turku in Finland, people who ate sucrose-sweetened diets developed twice as many decayed tooth surfaces over two years compared to those eating fructose-sweetened diets.

Starches add a wrinkle that surprises many people. Some snack foods that are low in sugar but high in starch actually cause a more severe and prolonged acid response in plaque than snacks high in sugar alone. Processed starches, like those in chips and crackers, break down into simple sugars in the mouth and tend to stick in the grooves of teeth. The sugar-to-starch ratio of a food matters: starchy foods that cling to teeth can be just as problematic as overtly sweet ones, sometimes more so because people don’t think of them as a cavity risk.

How Fluoride Changes the Chemistry

Fluoride protects teeth by altering enamel’s mineral structure at the atomic level. Normal enamel is made of hydroxyapatite. When fluoride is present, it replaces some of the hydroxyl groups in the crystal with smaller fluoride ions. This allows the phosphate ions in the crystal to pack more tightly together, which increases the attractive forces between the mineral’s charged components.

The result is a modified mineral called fluorapatite (or more precisely, fluorohydroxyapatite) that is significantly more stable and resistant to acid dissolution. In practical terms, fluoride-treated enamel doesn’t begin dissolving as quickly when the pH drops, buying your saliva more time to neutralize the acid and begin repairs. Fluoride in saliva and plaque fluid also helps drive the remineralization process, encouraging calcium and phosphate to redeposit onto weakened enamel surfaces.

Genetics Play a Real Role

Some people do everything right and still get cavities. There is strong evidence that genetics influence cavity risk independently of diet and hygiene. A meta-analysis found that variations in genes responsible for enamel development (particularly TUFT1 and AMBN, which code for proteins that build enamel during tooth formation) are associated with increased cavity risk. In one study of adults aged 21 to 32, those with a specific variant of the TUFT1 gene had significantly more decayed, missing, or filled teeth than those without it, even when controlling for diet and hygiene habits.

Genetic influence goes beyond enamel quality. Researchers have identified at least four categories of genes that affect cavity susceptibility: those governing enamel formation, saliva composition, immune response in the mouth, and taste perception. Variations in taste receptor genes (like TAS1R2) and sugar transport genes (like GLUT2) may influence cravings for sweet foods, indirectly raising risk. Differences in saliva composition affect how well your mouth buffers acid and supplies minerals for repair. The upshot is that cavity risk is partly inherited, which explains why some people with excellent brushing habits still struggle while others with mediocre habits rarely develop decay.

Putting It All Together

A cavity forms when the balance tips too far toward destruction. Acid-producing bacteria, fueled by fermentable carbohydrates, lower the pH at the tooth surface. If the pH stays below the critical threshold long enough and often enough, mineral loss outpaces mineral repair, and a cavity develops. The factors that tip that balance include how often you eat sugary or starchy foods, how effectively your saliva buffers acid and delivers minerals, how well you disrupt the bacterial biofilm through brushing and flossing, whether fluoride is present to harden the enamel, and the genetic hand you were dealt for enamel strength and saliva quality.

No single factor causes cavities on its own. Sugar doesn’t cause cavities without bacteria to ferment it. Bacteria don’t cause cavities without carbohydrates to feed on. And even with both present, strong saliva flow and good fluoride exposure can keep the balance tipped toward repair. The most effective prevention targets multiple points in the chain: reducing the frequency of carbohydrate exposure, breaking up plaque before it matures, maintaining saliva flow, and ensuring fluoride is available at the tooth surface.