Cavities form when acid-producing bacteria in your mouth feed on sugars and starches from the food you eat, creating acids that slowly dissolve your tooth enamel. This process doesn’t happen overnight. It’s a gradual tug-of-war between damage and repair, and cavities develop when the damage side wins consistently over weeks or months.
How Bacteria Turn Food Into Acid
Your mouth is home to hundreds of bacterial species, but a specific group called mutans streptococci does the most damage. These bacteria have three traits that make them especially good at causing decay: they can break down a wide range of sugars and starches, they produce sticky polymers that help them cling to your teeth, and they can keep functioning in highly acidic environments where other bacteria would die off.
Every time you eat or drink something containing carbohydrates, these bacteria begin fermenting those sugars almost immediately. The byproduct is acid, primarily lactic acid, which lowers the pH on the surface of your teeth. What makes these bacteria particularly destructive is that they can keep producing acid even when the environment around them drops to a pH of 4.4, which is acidic enough to dissolve enamel. Most other oral bacteria shut down well before that point. So once these acid-loving species take over a spot on your tooth, they create a self-reinforcing cycle: more acid drives away competing bacteria, giving them more room to produce even more acid.
The Balance Between Damage and Repair
Your teeth aren’t defenseless. Saliva is your mouth’s natural repair system. It contains calcium and phosphate ions that can redeposit into weakened spots on your enamel, essentially patching tiny areas of damage before they become full cavities. Saliva also contains bicarbonate, which acts as a buffer to neutralize the acids bacteria produce.
This back-and-forth between acid attack and mineral repair happens all day long. After you eat, the pH in your mouth drops as bacteria produce acid, and it takes roughly 20 to 30 minutes for saliva to bring conditions back to neutral. If you eat three meals a day with no snacking, your teeth get long stretches of recovery time. But if you sip sugary drinks throughout the afternoon or snack constantly, your teeth spend most of the day under acid attack with little time for saliva to do its repair work. That’s why frequency of sugar exposure often matters more than total amount.
Fluoride supercharges this repair process. When fluoride is present during remineralization, the rebuilt enamel incorporates it into its crystal structure, making the repaired surface harder and more acid-resistant than the original. This is why fluoride toothpaste and fluoridated drinking water (recommended at 0.7 parts per million) are so effective at preventing cavities.
What Cavities Look Like as They Progress
Tooth decay moves through distinct stages, and catching it early makes a real difference because the first stage is actually reversible.
- White spots (demineralization): The earliest sign is a chalky white patch on the tooth surface. This means minerals are leaving the enamel faster than they’re being replaced, but no permanent hole has formed yet. With better brushing, fluoride, and reduced sugar intake, these spots can remineralize and heal on their own.
- Enamel decay: If demineralization continues, the white spot may darken to brown and a small pit or hole forms in the enamel. This is the point most people think of as “getting a cavity.” It won’t heal on its own and typically needs a filling.
- Dentin decay: Beneath your enamel sits dentin, a softer tissue that decays faster once exposed. At this stage you may start feeling sensitivity to hot, cold, or sweet foods.
- Pulp involvement: If decay reaches the innermost pulp, which contains nerves and blood vessels, you’ll likely experience significant pain. Treatment at this stage usually involves more than a simple filling.
- Abscess: Untreated pulp infection can spread beyond the tooth root, forming a pocket of pus and potentially causing swelling, fever, and serious complications.
Why Some People Get More Cavities Than Others
Diet and brushing habits are the most obvious factors, but they don’t tell the whole story. Some people brush diligently and still get cavities, while others seem to get away with less-than-perfect habits. Several less obvious factors explain the difference.
Dry mouth is one of the biggest hidden risk factors. Without adequate saliva flow, your mouth loses its primary defense against acid. Hundreds of commonly prescribed medications reduce saliva production, including antidepressants, antihistamines, blood pressure medications (beta-blockers and diuretics), bladder medications, decongestants, muscle relaxants, and opioid pain medications. Chemotherapy drugs, thyroid supplements, and HIV medications can also dry out your mouth. If you take any of these and notice your mouth feels consistently dry, that’s worth addressing because the cavity risk increases substantially.
The natural shape of your teeth also plays a role. Deep grooves and pits on the chewing surfaces of molars trap food and bacteria in places a toothbrush can’t easily reach. Some people simply have deeper grooves than others, making them more cavity-prone in those spots regardless of hygiene.
Your individual bacterial makeup matters too. People carry different amounts of the cavity-causing bacteria, and those with higher populations of mutans streptococci face a steeper uphill battle. These bacteria are typically transmitted in early childhood, often from a caregiver’s saliva.
What Actually Prevents Cavities
Prevention comes down to disrupting the process at every step: limiting the fuel bacteria use, removing bacterial buildup, and strengthening the repair side of the equation.
Reducing how often you expose your teeth to sugar and refined carbohydrates matters more than obsessing over total sugar grams. Drinking a soda in five minutes is less damaging than sipping one over two hours, because the five-minute version gives your saliva time to recover. The same logic applies to candy, juice, sweetened coffee, and starchy snacks like crackers and chips.
Brushing twice a day with fluoride toothpaste clears away bacterial film (plaque) before it can harden into tarite, and delivers fluoride directly to your enamel. Flossing or using interdental brushes cleans the tight spaces between teeth where cavities frequently start but are hard to see.
Staying hydrated and addressing dry mouth keeps your saliva flowing. If medications are causing dryness, sugar-free gum or lozenges can stimulate saliva production. Some people benefit from saliva substitutes or prescription rinses.
Regular dental cleanings remove hardened plaque (calculus) that you can’t remove at home, and routine exams catch white-spot lesions before they progress to actual holes. Dental sealants, thin coatings painted onto the chewing surfaces of back teeth, are especially effective for children and teenagers whose deep molar grooves are most vulnerable.

