Cavities form when acid produced by bacteria in your mouth dissolves the hard outer layer of your teeth. It’s a gradual process, not a sudden event, and it depends on a chain of factors: what you eat, which bacteria thrive in your mouth, how much saliva you produce, and how well you clean your teeth. About 21% of American adults between 20 and 64 have at least one untreated cavity right now, making it one of the most common chronic conditions in the country.
Bacteria Turn Sugar Into Acid
Your mouth is home to hundreds of species of bacteria, but one group in particular drives tooth decay. These acid-producing bacteria feed on the carbohydrates left on your teeth after you eat or drink. They ferment those sugars through the same basic process yeast uses to make alcohol, except the main byproduct here is lactic acid rather than ethanol.
When you eat something sugary or starchy, these bacteria metabolize the carbohydrates and release organic acids directly onto your tooth surfaces. If this happens occasionally, your teeth can handle it. But when sugar intake is frequent, the acid production becomes nearly constant. The environment around your teeth stays acidic for long stretches, and that’s when real damage begins.
Sucrose (table sugar) is especially problematic. Frequent sucrose consumption shifts the bacterial community in your mouth, favoring species that are both excellent at producing acid and unusually tolerant of acidic conditions. This creates a feedback loop: more acid-loving bacteria means more acid, which means an even more hospitable environment for those same bacteria.
How Acid Breaks Down Enamel
Tooth enamel is made of a crystalline mineral called hydroxyapatite. It’s the hardest substance in your body, but it has a specific vulnerability: it begins dissolving when the pH around it drops below 5.5. For reference, a neutral pH is 7.0, and most sodas sit around 2.5 to 3.5.
Each time acid pushes the pH below that 5.5 threshold, calcium and phosphate ions are pulled out of the enamel crystals. This is demineralization. In early stages, the enamel develops microscopic voids in its crystal structure, appearing as chalky white spots on the tooth surface. At this point, the process is still reversible. But if acid attacks continue faster than the tooth can repair itself, the enamel eventually breaks down entirely, creating a physical hole: a cavity. Once the decay penetrates through the enamel into the softer tissue underneath (dentin), it accelerates and typically causes sensitivity to sweets, cold temperatures, or pressure when chewing.
Your Saliva Fights Back
Saliva is your mouth’s primary defense against cavities. It works in several ways at once. First, it physically washes away food particles and bacteria. Second, it contains buffering compounds that neutralize acids and bring the pH back to safe levels after you eat. Third, and most importantly for tooth repair, saliva is rich in dissolved calcium and phosphate ions.
These minerals in your saliva can actually redeposit into the tiny voids that acid creates in enamel, filling in early damage before it becomes a cavity. This is remineralization, and it’s happening constantly throughout the day. The balance between demineralization (acid pulling minerals out) and remineralization (saliva putting minerals back) determines whether a cavity forms. Anything that tips that balance toward more acid or less repair increases your risk.
Why Cavities Form Between Teeth
Not all cavities show up on the chewing surfaces where you might expect them. Cavities that form between teeth, called interproximal cavities, are particularly common and sneaky. The tight spaces between teeth trap food and plaque that your toothbrush bristles simply can’t reach. Bacteria thrive in these sheltered spots, producing acid against enamel surfaces you can’t see or feel.
You’ll typically have no idea these cavities exist until they’ve grown large enough to reach the dentin layer, at which point you might notice sensitivity or discomfort. This is why flossing matters: it’s the only way to physically disrupt the bacterial colonies growing in those gaps. It’s also why dentists rely on X-rays to catch decay between teeth before it becomes painful.
Dry Mouth Dramatically Raises Risk
Because saliva is so central to cavity prevention, anything that reduces saliva flow puts your teeth at serious risk. The most common cause of chronically dry mouth is medication. Over 100 medications have moderate to strong evidence of reducing saliva production, spanning a wide range of drug types: antihistamines, antidepressants, blood pressure medications, decongestants, pain medications, diuretics, muscle relaxants, and GLP-1 receptor agonists (a class of drugs increasingly prescribed for diabetes and weight loss).
Medications with anticholinergic effects are the biggest offenders. These include older antidepressants, antihistamines, blood pressure drugs, and anti-seizure medications. If you take any of these and notice your mouth feels persistently dry, that’s not just uncomfortable. It means your teeth are sitting in a less-protected environment around the clock, with less buffering against acid and fewer minerals available for repair.
Genetics Play a Smaller Role Than You Think
Some people seem to get cavities no matter what they do, which raises a natural question about genetics. Researchers have identified specific gene variants associated with higher rates of decay, particularly in genes involved in enamel development. People carrying certain variants of the TUFT1 gene, for instance, show significantly higher rates of cavities.
Here’s what’s interesting, though: when researchers measured the actual physical properties of these people’s enamel (thickness, hardness, mineral content), the enamel looked essentially the same as everyone else’s. The genetic influence doesn’t seem to work by making enamel weaker or thinner. Instead, it may affect how well the enamel surface resists bacterial attachment, or how effectively the remineralization process works. One clear finding did emerge: lower calcium content in enamel was strongly correlated with more cavities, regardless of genetic variant. So while your genes may nudge your risk in one direction, they don’t override the basics of oral hygiene and diet.
How Fluoride Changes the Math
Fluoride protects teeth by chemically transforming the enamel surface. When fluoride is present (from toothpaste, drinking water, or professional treatments), it integrates into the enamel’s crystal structure, converting hydroxyapatite into a different mineral called fluorapatite. This matters because fluorapatite is significantly more acid-resistant. While regular enamel starts dissolving at pH 5.5, fluoride-treated enamel holds up until pH drops below 4.6. That’s a meaningful difference in chemistry terms, giving your teeth a wider safety margin against the acid attacks that happen every time you eat.
Fluoride also supports remineralization. When calcium and phosphate from your saliva redeposit into damaged enamel in the presence of fluoride, the repaired mineral is harder than what was there originally. This is why consistent fluoride exposure through toothpaste is one of the most effective cavity prevention tools available.
The Factors That Add Up
Cavities rarely come down to a single cause. They result from an overlap of conditions sustained over time. Frequent snacking keeps your mouth acidic for longer stretches, giving saliva less time to neutralize and repair. Sticky or starchy foods cling to teeth and feed bacteria for hours. Poor brushing and flossing leave plaque undisturbed, letting bacterial colonies mature and produce more acid. Dry mouth removes your natural defense system. And some people’s biology makes them slightly more vulnerable to begin with.
The timeline matters too. A cavity doesn’t appear overnight. The early white-spot stage can persist for weeks or months before progressing to an actual hole. During that window, improving your oral hygiene, reducing sugar frequency, and using fluoride toothpaste can halt or even reverse the process. The goal isn’t to eliminate bacteria from your mouth (that’s impossible and unnecessary) but to keep the balance tipped toward repair rather than destruction.