What Causes Cavities: Bacteria, Sugar, and Dry Mouth

Cavities form when bacteria in your mouth feed on sugars and produce acid that dissolves tooth enamel. It’s a slow, incremental process, not something that happens overnight. Untreated tooth decay in permanent teeth is the single most common health condition worldwide, according to the Global Burden of Disease 2021.

How Acid Breaks Down Your Teeth

Your mouth is home to 200 to 300 bacterial species, but only a few actually cause cavities. The primary culprit is a bacterium called Streptococcus mutans. When you eat or drink something containing sugar or starch, S. mutans and similar bacteria metabolize those carbohydrates and produce organic acids, mainly lactic acid. These acids accumulate in the sticky film of bacteria coating your teeth (dental plaque) and lower the pH at the tooth surface.

At a normal pH, your saliva is supersaturated with calcium and phosphate, the minerals that make up your enamel. That means minerals aren’t leaving your teeth. But when the pH at the tooth surface drops to around 5.5, saliva loses that supersaturation and minerals start dissolving out of the enamel. The spaces between enamel crystals widen, the surface softens, and acid penetrates deeper. If these acid attacks keep happening faster than your teeth can recover, a cavity eventually forms.

The Bacteria Behind It

S. mutans initiates the process. It’s especially dangerous because it stores polysaccharides and continues secreting acid long after you’ve swallowed your food. It also thrives in acidic conditions, giving it an advantage over less harmful bacteria in your mouth. As the initial damage progresses, the environment becomes even more acidic, which favors a second group of bacteria called lactobacilli. These are the most acid-tolerant bacteria in plaque, and they dominate once decay has penetrated into the deeper layer of the tooth (the dentin). So cavities are really a two-stage infection: S. mutans starts the damage, and lactobacilli drive it deeper.

Which Foods Cause the Most Damage

Cavities cannot develop without fermentable carbohydrates in the diet. That’s a well-established finding: no fermentable carbs, no decay. But not all sugars are equally harmful.

Sucrose, ordinary table sugar, is the most cariogenic dietary factor. In controlled studies, people consuming sucrose developed twice as many decayed, missing, or filled tooth surfaces compared to those consuming fructose. Glucose and fructose can also cause cavities, but they appear less damaging than sucrose. Even complex carbohydrates like starches are cariogenic to some degree, though less so than simple sugars.

Frequency matters as much as quantity. Every time you eat or drink something sugary, you trigger a new acid attack that can last 20 to 30 minutes. Sipping soda throughout the day or snacking constantly keeps the pH in your mouth low for extended periods, giving your enamel almost no time to recover between exposures.

Your Saliva Is a Repair System

Saliva is your body’s primary defense against cavities, and it works in several ways. It contains three buffering systems (bicarbonate, phosphate, and protein-based) that neutralize acid after you eat. It carries calcium and phosphate ions that can actually redeposit into weakened enamel, repairing early damage before a cavity forms. Certain salivary proteins, including statherin and proline-rich proteins, bind to enamel surfaces and increase the local concentration of calcium, further supporting this repair process.

Your saliva even builds a thin protective film on your teeth called the salivary pellicle. The calcium phosphate embedded in this film is about ten times more soluble than the mineral in your actual tooth, so when acid attacks, the pellicle dissolves first, acting as a sacrificial shield. This is why anything that reduces your saliva flow dramatically increases your cavity risk.

Dry Mouth and Medication Risk

When saliva production drops, a condition called xerostomia, you lose most of those protective mechanisms at once: less buffering, fewer repair minerals, and a weaker pellicle. The result is a sharp increase in cavities. Many common medications cause dry mouth as a side effect. Anticholinergic drugs are the biggest offenders, including tricyclic antidepressants, antipsychotics, antihistamines, opioids, and antispasmodics. Medications that affect the sympathetic nervous system can also reduce saliva flow: blood pressure medications, newer antidepressants (SSRIs and SNRIs), decongestants like pseudoephedrine, and bronchodilators. The more medications a person takes, the greater the risk, since the drying effects tend to compound.

Why Some Teeth Decay Faster Than Others

Even with perfect brushing habits, certain teeth are harder to protect. The chewing surfaces of your back teeth (molars and premolars) have pits and fissures that can be extraordinarily complex in shape. Some are deep, narrow slits resembling bottlenecks or inverted Y-shaped channels. These grooves are too narrow for toothbrush bristles to reach, creating sheltered environments where bacteria accumulate undisturbed. Fluoride from toothpaste also has less contact with these recessed surfaces compared to the smooth sides of teeth. This is why the chewing surfaces of molars carry the highest cavity risk, and why dental sealants (thin coatings painted into the grooves) are recommended for children’s permanent molars.

How a Cavity Develops Stage by Stage

The earliest sign of decay is a white spot on the enamel, an area where minerals have started leaching out but the surface is still intact. At this stage, the process is fully reversible. Minerals from saliva and fluoride from toothpaste can redeposit into the weakened area and restore the enamel. This is one reason consistent fluoride exposure matters: fluoride ions swap into the enamel’s crystal structure, creating a modified mineral that packs more tightly and resists acid far better than the original. When pH drops from 7 to 5, the original enamel mineral loses about 99.99% of its stability, while the fluoride-modified version loses only about 3%. That difference is enormous.

If acid attacks continue unchecked, the subsurface enamel loses minerals faster than the surface, hollowing out a weak zone beneath what still looks like intact tooth. Eventually the surface collapses and a true cavity forms. This is permanent structural damage that only a filling can repair. Left untreated, bacteria push through the enamel into the softer dentin underneath, where lactobacilli take over and decay accelerates. From there, infection can reach the pulp (the nerve and blood supply inside the tooth), causing pain, abscess, and potential tooth loss.

What Actually Prevents Cavities

Since cavities require three ingredients (bacteria, fermentable carbohydrates, and time), prevention targets all three. Brushing and flossing physically remove the bacterial film before it can produce enough acid to do damage. Reducing the frequency of sugar exposure limits the number of acid attacks your enamel faces each day. Fluoride toothpaste strengthens enamel and makes it more resistant to future acid exposure.

For people at higher risk, whether from dry mouth, deep tooth grooves, or a history of frequent cavities, additional strategies help. Drinking water throughout the day supports saliva function. Sugar-free gum stimulates saliva flow after meals. Dental sealants protect vulnerable molar surfaces. And if medications are drying your mouth, that’s worth discussing with your prescriber, since sometimes an alternative drug carries less oral risk.