Cavities form when acids produced by bacteria in your mouth dissolve the mineral structure of your teeth. This process isn’t instant. It’s a tug-of-war between acid attacks that strip minerals from enamel and your saliva’s ability to deposit those minerals back. A cavity develops when the balance tips toward destruction often enough and long enough that the damage becomes permanent. About one in five U.S. adults between 20 and 64 has at least one untreated cavity right now.
What Happens Inside Your Mouth
Your teeth are made almost entirely of a mineral crystal called hydroxyapatite, which is roughly 96% of enamel by weight. This crystal structure is strong, but it has a chemical weakness: it dissolves in acid. When the pH on a tooth’s surface drops below about 5.5, the crystals begin to break apart and release calcium and phosphate into the surrounding fluid. That’s the start of a cavity.
The acid doesn’t come from food directly. Hundreds of species of bacteria live in a sticky film on your teeth called plaque. When you eat carbohydrates, these bacteria metabolize the sugars and produce organic acids, primarily lactic acid, as a byproduct. That acid gets trapped between the plaque layer and the tooth surface, creating a concentrated zone of low pH right where it does the most damage.
One species in particular, Streptococcus mutans, is especially effective at causing decay for three reasons. It converts a wide range of sugars into acid very efficiently. It thrives in the acidic environment it creates, outlasting less acid-tolerant bacteria. And when sucrose is available, it produces a glue-like polymer called glucan that strengthens the plaque biofilm and helps it stick firmly to enamel. That sticky matrix also shields the bacteria inside, making the colony harder to disrupt with brushing or rinsing.
Why Snacking Matters More Than Sugar Amount
Every time you eat something containing fermentable carbohydrates, the pH on your tooth surfaces drops within minutes. Your saliva then works to neutralize the acid and bring the pH back to safe levels, a process that takes 20 to 40 minutes. During that recovery window, your saliva can also begin redepositing calcium and phosphate onto the enamel, partially repairing the damage.
The problem comes with frequency. If you snack or sip sugary drinks many times throughout the day, you restart the acid cycle before your saliva has finished its repair job. Each new sugar exposure triggers another pH crash, and the cumulative time your teeth spend in an acidic environment grows dramatically. Three meals a day gives your teeth long stretches of recovery. Six or eight sugar exposures, including that sweetened coffee you nurse all morning, keeps your enamel under near-constant attack.
Foods That Cause the Most Damage
Sucrose (table sugar) has the greatest cavity-causing potential of any carbohydrate, partly because bacteria use it not only for energy but also to build that sticky biofilm scaffold. Other simple sugars like glucose and fructose also feed acid-producing bacteria, though they appear somewhat less harmful than sucrose.
Starchy foods aren’t automatically safe. Research has found that some snacks low in sugar but high in starch cause a more severe and prolonged acid spike than snacks high in sugar alone. The sugar-to-starch ratio matters because starches break down into simpler sugars in the mouth, and their sticky texture can keep them clinging to tooth surfaces longer. Canned fruits have been shown to lower plaque pH more than sugar by itself, likely due to their combination of natural sugars and fruit acids. Soft drinks deliver a double hit: fermentable sugars plus citric acid that directly erodes enamel without any bacterial help.
Your Teeth Aren’t All Equally Vulnerable
The chewing surfaces of your back teeth have deep grooves and pits that are natural traps for bacteria and food debris. These surfaces make up only about 12% of total tooth area in your mouth, yet they’re eight times more vulnerable to decay than smooth surfaces. Narrow, deep fissures are especially problematic because toothbrush bristles can’t reach the bottom, and even fluoride has limited access. This is why about 90% of cavities in permanent back teeth start in pits and fissures. Dental sealants, a thin coating applied over these grooves, exist specifically to address this vulnerability.
Spots where teeth contact each other are the second most common location for cavities. Plaque accumulates in these tight spaces, and without flossing, it sits undisturbed for hours or days at a time.
How Your Body Fights Back
Saliva is your primary natural defense. It contains dissolved calcium and phosphate ions that can recrystallize onto damaged enamel, essentially patching early mineral loss before it becomes a full cavity. Saliva also buffers acid, washing away food particles and diluting the acids that bacteria produce. The flow rate matters: stimulated saliva during meals is far more protective than the reduced flow that occurs during sleep, which is one reason going to bed without brushing is particularly harmful.
Fluoride supercharges this repair process. When fluoride is present during remineralization, it substitutes into the crystal structure of enamel, replacing the original hydroxyl groups with fluoride ions. The resulting mineral is harder, more stable, and more resistant to acid dissolution than the original enamel. This is why fluoride toothpaste and fluoridated water reduce cavities: they don’t just coat the teeth, they chemically transform the repaired enamel into a tougher version of itself.
Dry Mouth Accelerates Decay
Anything that reduces saliva flow removes your main protective mechanism and lets acid linger on tooth surfaces. One of the most common causes of dry mouth is medication. Antidepressants, antihistamines, blood pressure medications, diuretics, anti-anxiety drugs, and muscle relaxants can all reduce salivary flow through various pathways. Some drugs block nerve signals to salivary glands, others cause dehydration, and some constrict blood vessels supplying the glands.
People who start a new medication and notice a persistently dry mouth often develop cavities rapidly, sometimes in locations they’ve never had problems before. This is also why older adults, who tend to take more medications, can experience a sudden uptick in decay despite decades of good dental health. Sugar-free chewing gum can help by mechanically stimulating saliva production, and staying well hydrated supports salivary flow throughout the day.
The Tipping Point From Damage to Cavity
Early mineral loss is invisible and fully reversible. At this stage, called a white spot lesion, the enamel surface looks chalky but is still intact. If conditions improve (better brushing, less frequent sugar, fluoride exposure), saliva can rebuild the weakened area completely.
Once enough mineral has been lost that the surface collapses inward, forming an actual hole, the damage is permanent. Enamel doesn’t contain living cells, so your body can’t grow it back. The rough edges of a cavity trap even more bacteria and food, accelerating the process. If the decay reaches the softer layer beneath enamel (dentin), it spreads faster because dentin begins dissolving at a higher pH of around 6.0, meaning it takes less acid to do damage. Left untreated, the decay eventually reaches the nerve and blood supply inside the tooth, causing pain and infection.
The entire process from first mineral loss to a visible cavity can take months or years, depending on how often your teeth face acid attacks, how much saliva you produce, whether fluoride is present, and the physical shape of your teeth. Cavities aren’t caused by a single piece of candy. They’re the result of a pattern, repeated acid exposure that outpaces your mouth’s ability to heal.

