How to Get a Cavity: The Science of Tooth Decay

Cavities form when acid produced by bacteria in your mouth dissolves the mineral structure of your teeth. This process isn’t instant. It requires a specific combination of bacteria, food, time, and vulnerability, and it plays out over months to years before you’d ever notice a hole in your tooth. Understanding exactly how each factor contributes can help you see where the chain breaks and where it doesn’t.

What Actually Happens Inside Your Tooth

Your tooth enamel is made of a tightly packed mineral called hydroxyapatite. It’s the hardest substance in the human body, but it has a chemical weakness: acid dissolves it. When the pH at the tooth surface drops below about 5.5, the hydroxyapatite begins releasing calcium and phosphate ions into the surrounding fluid. This is demineralization, and it’s the very first step in getting a cavity.

The acid doesn’t come from food directly. Bacteria living in the film of plaque on your teeth feed on carbohydrates, and their metabolic waste product is acid. Every time you eat something containing sugar or starch, those bacteria produce a burst of acid that can push the pH at the tooth surface well below the critical 5.5 threshold. The mouth stays acidic for roughly 20 to 30 minutes after each exposure before saliva can bring the pH back to a safe range. If you’re snacking frequently, your teeth spend more total time in that acidic danger zone.

Interestingly, the critical pH isn’t the same for everyone. Research from Erbil Dental Journal found that people who already have some decay experience demineralization at a higher (less acidic) pH, around 6.5 to 6.7, compared to roughly 6.1 for people with no history of cavities. In other words, the more damage your teeth have already sustained, the more vulnerable they become to further damage.

The Foods That Feed Decay

Sucrose (table sugar) gets most of the blame, but it’s not the only culprit. Bacteria can metabolize most dietary carbohydrates, including glucose, fructose, and cooked starches. Chips, crackers, bread, dried fruit, candy, soda, juice: all of these provide fuel for acid production. The U.S. federal health code formally recognizes the relationship between “fermentable carbohydrates, i.e., dietary sugars and starches,” and tooth decay.

What matters as much as what you eat is how often and how long. A single candy bar eaten in five minutes exposes your teeth to one acid attack. Sipping a sugary coffee over three hours exposes them to a nearly continuous one. Frequent between-meal snacks high in sugars and starches are more damaging than eating those same foods at a meal, partly because meals stimulate more saliva flow and partly because the acid exposure is consolidated into a shorter window. Sticky foods that cling to tooth surfaces, like caramel, gummy candy, or dried fruit, extend that window further.

Why Saliva Is Your Best Natural Defense

Saliva does far more than keep your mouth moist. It’s about 98% water, but the remaining 2% contains a surprisingly effective toolkit against cavities. Bicarbonate, phosphate, and certain peptides act as buffering agents, neutralizing acid in plaque. Saliva also carries dissolved calcium and phosphate ions, which can redeposit onto enamel and actually reverse early demineralization. On top of that, enzymes like lysozyme and lactoferrin inhibit bacterial growth directly.

This is why anything that reduces saliva flow dramatically increases cavity risk. Your mouth is constantly washing your teeth, buffering acid, killing bacteria, and restocking minerals. When that system slows down, the balance tips hard in favor of decay.

Medications That Dry Your Mouth

The most common cause of reduced saliva flow is medication. According to the American Dental Association, over 100 medications have strong to moderate evidence of disrupting salivary gland function. The most frequent offenders are drugs with anticholinergic effects: certain antidepressants, antihistamines, blood pressure medications, and antispasmodics. But the list also includes decongestants, pain medications, diuretics, muscle relaxants, and GLP-1 receptor agonists (a class of drugs increasingly prescribed for diabetes and weight loss).

Without adequate saliva, you lose your primary acid-neutralizing mechanism. People with chronic dry mouth often develop cavities in unusual locations, like along the gum line, on root surfaces, or on the tips of teeth, areas that saliva would normally protect. If you take any of these medications regularly, the reduced saliva flow alone can be enough to tip the balance toward decay even if your diet and brushing habits haven’t changed.

The Timeline From Start to Hole

A cavity doesn’t appear overnight. The first visible sign is a white spot lesion: an opaque, chalky white or yellowish patch on the enamel surface. This marks an area where minerals have been lost but the surface hasn’t actually broken down yet. At this stage, the process is still reversible. Fluoride, improved hygiene, and reduced sugar exposure can allow saliva to rebuild the lost mineral.

If nothing changes, the lesion progresses. A retrospective study published in the Journal of Clinical Pediatric Dentistry tracked the rate of cavity progression in primary teeth and found it took approximately 0.8 years (about 10 months) for a lesion to advance from the outer enamel through to the border where enamel meets the softer dentin underneath. Once past that border, the decay accelerated through the dentin, reaching the inner portion in an additional 1.4 years. From initial detection to deep decay: roughly 2.2 years total. Adult teeth tend to progress somewhat more slowly, but the general pattern holds. You typically have a window of many months to catch and reverse early damage before it becomes a permanent hole.

How Fluoride Changes the Chemistry

Fluoride works by swapping into the mineral structure of your enamel. When fluoride ions are present during remineralization, they replace some of the hydroxide groups in hydroxyapatite, creating a modified mineral called fluorapatite. Fluorapatite is stronger and more acid-resistant than the original enamel mineral, meaning it takes a lower pH to dissolve it. This is why fluoride toothpaste and fluoridated water reduce cavity rates: they don’t just repair damage, they make the repaired enamel harder to damage again.

Fluoride in toothpaste also has a direct antibacterial effect at the tooth surface, reducing the amount of acid bacteria can produce. The combination of tougher enamel and less acid is what makes fluoride the single most effective chemical intervention against cavities.

The Recipe for a Cavity

Cavities require four ingredients working together: bacteria in plaque, fermentable carbohydrates, time, and a vulnerable tooth surface. Remove or weaken any one of these and the process stalls. Here’s what pushes each factor in the wrong direction:

  • More bacteria: Infrequent brushing and flossing allow plaque to build up and mature, concentrating acid-producing bacteria against the tooth surface.
  • More fuel: Frequent sugar and starch intake, especially between meals, gives bacteria a near-constant supply of carbohydrates to ferment into acid.
  • More time: Sipping sugary drinks over hours, sucking on hard candies, or letting sticky foods sit on teeth extends each acid attack.
  • Less protection: Dry mouth from medications, mouth breathing, dehydration, or medical conditions removes the saliva that would otherwise neutralize acid and rebuild enamel. Skipping fluoride toothpaste leaves enamel in its more acid-soluble form.

The spots most likely to develop cavities are the ones hardest to keep clean: the grooves on the chewing surfaces of back teeth, the tight spaces between teeth where only floss reaches, and areas along the gum line. These are places where plaque sits undisturbed longest, giving bacteria the most time to work.

Why Some People Get More Cavities Than Others

Genetics plays a real but often overstated role. Some people have naturally deeper grooves in their teeth, thinner enamel, or saliva with lower buffering capacity. The bacterial composition of your mouth also varies from person to person and is partly established in early childhood. But the biggest differences in cavity rates come down to behavior and environment: how often you eat sugar, whether you use fluoride, how well you clean your teeth, and whether medications or medical conditions have reduced your saliva flow.

People who had cavities before are statistically more likely to get new ones, not just because of habits, but because their enamel demineralizes at a less acidic pH than someone with no cavity history. Past decay makes future decay easier, which is one reason early intervention matters so much.