What Causes Cavities: Bacteria, Sugar, and Dry Mouth

Cavities form when acid dissolves the minerals in your tooth enamel faster than your body can repair them. That acid comes from bacteria living on your teeth, but the full picture involves your diet, your saliva, your tooth anatomy, medications you take, and habits you might not realize matter. Understanding all these factors helps explain why some people seem prone to cavities even when they brush regularly.

How a Cavity Actually Forms

Your mouth is home to hundreds of species of bacteria, and some of them feed on the sugars and starches you eat. As they digest these carbohydrates, they produce organic acids as a byproduct. Those acids lower the pH on your tooth surface, and when the pH drops below about 5.5, the minerals that make up your enamel start to dissolve. This process is called demineralization.

Tooth enamel is 96% hydroxyapatite, a crystalline structure built from calcium and phosphate ions. Normally, your saliva keeps calcium and phosphate levels balanced against the mineral in your teeth. But when bacterial acid floods the area, the chemistry shifts. Phosphate gets pulled out of the enamel to restore balance in the surrounding fluid, and the tooth surface slowly breaks down. If this happens often enough without time for repair, a cavity develops.

The earliest visible sign is a white spot on the tooth, a chalky patch where minerals have been lost but the surface hasn’t yet broken through. At this stage, the damage is actually reversible. Fluoride, calcium, and phosphate from saliva can rebuild the weakened enamel if the acid attacks stop long enough. Once the surface collapses into an actual hole, though, the cavity is permanent and needs a filling.

The Bacteria Behind the Acid

Not all mouth bacteria cause cavities. The primary culprit is Streptococcus mutans, first isolated from decayed teeth in 1924. What makes this bacterium so effective at causing damage comes down to three traits: it produces sticky polymers from sucrose that help it cling to teeth, it can digest a wide range of sugars and starches, and it thrives in acidic environments that would slow down other bacteria. It can keep producing acid even at a pH as low as 4.4, well below the threshold where enamel dissolves.

These bacteria live in a film called plaque, the fuzzy coating you feel on your teeth when you haven’t brushed. Plaque is a structured community, a biofilm, that shelters bacteria and concentrates their acid output right against the tooth surface. The longer plaque sits undisturbed, the more acid accumulates underneath it and the more damage occurs.

Sugar, Starch, and Frequency

Sugar is the most well-known cavity cause, but it’s not the only dietary trigger. Any fermentable carbohydrate will do. Starchy foods like crackers, chips, and bread get broken down by an enzyme in your saliva into simpler sugars that mouth bacteria can use. Naturally occurring sugars in fruit and milk also feed those bacteria, though whole fruits tend to be less of a problem because of their fiber and water content.

How often you eat matters more than how much you eat at once. Every time sugar or starch hits your teeth, bacteria produce acid for roughly 20 to 30 minutes. If you sip a sugary drink over two hours, you’re giving your teeth a near-constant acid bath. Eating the same amount of sugar in one sitting and then stopping causes a single acid spike that your saliva can neutralize more quickly. Sticky foods like dried fruit, caramel, and gummy candy are especially problematic because they cling to tooth surfaces and extend that acid exposure window.

Why Saliva Is Your Best Defense

Saliva does more for your teeth than most people realize. It rinses food particles off tooth surfaces, neutralizes bacterial acid, and delivers calcium, phosphate, and fluoride ions directly to enamel to rebuild early damage. A healthy flow of saliva is one of the strongest natural protections against cavities.

When saliva production drops, cavity risk rises dramatically. This condition, called dry mouth, removes your teeth’s primary chemical defense. Without enough saliva to buffer acids and resupply minerals, even moderate sugar intake can lead to rapid decay. People with chronic dry mouth often develop cavities along the gum line and on tooth surfaces that would normally stay healthy.

Medications That Dry Out Your Mouth

Dry mouth is one of the most common medication side effects, and dozens of drug classes can cause it. Antidepressants (both SSRIs and older tricyclics), blood pressure medications, antihistamines, decongestants, muscle relaxants, opioids, and sedatives all reduce saliva flow. Bronchodilators used for asthma, appetite suppressants, and acid reflux medications like proton pump inhibitors can contribute as well. Chemotherapy drugs and anti-HIV medications are also known to cause significant dry mouth.

If you take one of these medications and notice your mouth feels dry or sticky, especially at night, that’s a real cavity risk factor worth addressing. Staying hydrated, using sugar-free gum to stimulate saliva, and talking to your dentist about fluoride rinses can help offset the effect.

Tooth Shape and Location

Your back teeth, the molars and premolars, are far more cavity-prone than your front teeth. They have deep grooves, pits, and crevices on their chewing surfaces that trap food particles and harbor bacteria. A toothbrush bristle is often too wide to reach the bottom of these grooves, which means plaque can build up there even with diligent brushing.

This is exactly why dental sealants exist. A sealant is a thin plastic coating painted over the chewing surface of back teeth that fills in those grooves and creates a smooth, cleanable surface. They’re most commonly applied to children’s permanent molars shortly after they come in, but adults with deep grooves and no existing fillings can benefit from them too.

Acid From Sources Other Than Bacteria

Bacteria aren’t the only source of acid that damages teeth. Acidic foods and drinks, including citrus, soda, wine, and sports drinks, lower the pH in your mouth directly. This type of damage is technically erosion rather than a cavity, but it weakens enamel and makes teeth more vulnerable to bacterial decay afterward. Frequent vomiting from conditions like bulimia or severe acid reflux exposes teeth to stomach acid, which is far more acidic than anything bacteria produce.

Vaping and Smoking

Vaping increases cavity risk through several mechanisms. The propylene glycol and vegetable glycerin in e-cigarette liquid vaporize into acidic compounds that erode enamel directly. Sweetened flavorings in the vapor create a sticky residue on teeth that fuels bacterial growth. Vaping also causes dry mouth, compounding the problem. Smoking has similar effects on saliva and blood flow to the gums, impairing your body’s ability to fight the bacteria in plaque.

Other Risk Factors That Add Up

Receding gums expose the roots of your teeth, which are covered by a material called cementum rather than enamel. Cementum starts dissolving at a higher pH (around 6.2 compared to 5.5 for enamel), making exposed roots much more vulnerable to decay. This is why older adults often develop cavities at the gum line even if they went decades without one.

Braces and other orthodontic hardware create extra surfaces where plaque can accumulate and make thorough brushing difficult. White spot lesions around brackets are a common sign of early decay during orthodontic treatment. Old fillings with rough or cracked edges can also trap bacteria in gaps between the restoration and the remaining tooth.

Genetics play a smaller but real role. Some people naturally have deeper tooth grooves, thinner enamel, or saliva with a lower mineral content. These factors don’t doom you to cavities, but they do mean you have less margin for error with diet and hygiene.

How Fluoride Counteracts Decay

Fluoride works by encouraging remineralization and making the repaired enamel more acid-resistant than the original. When fluoride is present during remineralization, it integrates into the crystal structure of the enamel, creating a form that doesn’t dissolve as easily the next time acid strikes. This is why fluoride toothpaste, fluoridated water (typically at 0.7 parts per million), and professional fluoride treatments are the cornerstone of cavity prevention. For children in areas without fluoridated water, supplemental fluoride may be recommended starting at six months of age, with the dose adjusted based on age and existing fluoride exposure.