Cavities form when acids produced by bacteria in your mouth dissolve the mineral structure of your teeth. This process doesn’t happen overnight. Most cavities take months or even years to develop, progressing through distinct stages as the damage moves deeper into the tooth. Understanding how this works helps explain why some people get more cavities than others and why early-stage decay can actually be reversed.
What Happens Inside Your Mouth
Your mouth is home to hundreds of species of bacteria, many of them harmless. The main troublemaker is Streptococcus mutans, a bacterium that thrives on sugars and starches. When you eat carbohydrates, these bacteria ferment them and produce acids, primarily lactic acid, as a byproduct. The bacteria also produce a sticky matrix that helps them cling to tooth surfaces, forming what dentists call plaque or biofilm.
This acid is what actually damages your teeth. Tooth enamel, the hard outer shell, is made of tightly packed mineral crystals called hydroxyapatite, composed largely of calcium and phosphate. When the acid hits these crystals, hydrogen ions bind with the phosphate and carbonate in the enamel, pulling calcium and other minerals out of the crystal structure. Think of it like acid rain slowly dissolving a marble statue. The minerals leave the tooth surface and dissolve into your saliva.
This process, called demineralization, kicks in when the pH on the tooth surface drops below about 5.5 for enamel. Dentin, the softer layer beneath enamel, starts dissolving at a higher pH of around 6.0, which is why decay accelerates once it reaches that layer.
The Acid Attack Timeline
Every time you eat something containing carbohydrates, you trigger what’s sometimes called an “acid attack.” Research measuring plaque pH in real time shows that the sharpest pH drop happens roughly 12 to 22 minutes after eating. In one study, white bread caused the greatest decrease, dropping plaque pH by 1.5 units below baseline within 22 minutes. Starchy foods like mashed potatoes, rice, pasta, and breakfast cereals all produced similar acid responses, not just sugary sweets.
Sucrose (table sugar) is the most efficiently fermented carbohydrate, but bacteria can also break down glucose, fructose, and cooked starches. The frequency of these acid attacks matters more than the total amount of sugar you eat. Sipping a sugary drink over two hours exposes your teeth to a near-continuous acid bath, while drinking the same amount in five minutes causes one short dip that your saliva can recover from.
How Saliva Fights Back
Your saliva is the primary defense against this constant acid assault. It works in three ways. First, it has buffering capacity, meaning it contains compounds that neutralize acids and push the pH back toward neutral. Second, saliva is a reservoir of dissolved calcium and phosphate ions. Once the pH stabilizes after an acid attack, these ions redeposit onto the weakened enamel surface, rebuilding the mineral crystals in a process called remineralization. The repaired crystals are sometimes more acid-resistant than the originals.
Saliva also contains antimicrobial proteins. Lysozyme and lactoperoxidase suppress the metabolism of cavity-causing bacteria, reducing the amount of acid they produce. Lactoferrin interferes with bacterial adhesion to tooth surfaces. This is why dry mouth is such a significant risk factor for cavities. When saliva flow drops, acidity rises, acid-producing bacteria proliferate, minerals leach away faster, and the mouth loses its ability to replenish those minerals.
Stages of Cavity Formation
A cavity doesn’t appear suddenly. It develops through a predictable sequence as the balance between demineralization and remineralization tips in the wrong direction over time.
White Spot Lesions
The earliest visible sign of decay is a white spot on the tooth surface. This chalky, opaque patch appears because minerals have been lost from below the surface, while the outermost layer of enamel remains relatively intact. At this stage, the damage is reversible. If you improve your oral hygiene, reduce sugar exposure, and give your saliva (along with fluoride) a chance to work, the minerals can be redeposited and the lesion can heal without any drilling. White spot lesions are common after orthodontic treatment, where brackets make thorough cleaning difficult.
Enamel Breakdown
If the acid attacks continue unchecked, the smooth enamel surface becomes rough and eventually develops tiny cracks and pits called microcavitations. Once the surface physically breaks down, the damage is no longer reversible with remineralization alone. At this point, bacteria and acid can penetrate into the interior of the enamel, accelerating the destruction from within. You typically won’t feel any pain at this stage because enamel has no nerve endings.
Dentin Involvement
Beneath the enamel lies dentin, a softer, more porous tissue that makes up the bulk of the tooth. Dentin dissolves at a higher pH than enamel, so once decay breaks through, it tends to spread faster. You may start noticing sensitivity to hot, cold, or sweet foods at this point. The tooth mounts a defense by producing a type of reparative dentin to try to wall off the advancing bacteria and protect the pulp underneath. Closer to the pulp, the innermost zone of dentin shows mineral loss but remains free of bacteria because they haven’t penetrated that deep yet.
Pulp Infection
If decay reaches the pulp, the soft tissue at the center of the tooth containing nerves and blood vessels, the result is usually significant pain, infection, and potential abscess formation. Treatment at this stage typically involves removing the infected pulp rather than a simple filling.
Why Some People Get More Cavities
Cavity formation isn’t just about brushing habits. Several factors shift the balance toward demineralization. Frequent snacking or sipping sugary or acidic drinks keeps the mouth in a prolonged acidic state, giving saliva little recovery time. Dry mouth, whether caused by medications, medical conditions, or mouth breathing, removes your most important natural defense. The specific mix of bacteria in your mouth matters too. Some people harbor more acid-producing species than others.
Diet plays a role beyond sugar. Dairy products contain proteins like casein that inhibit bacterial adhesion to teeth, and they supply calcium and phosphate that support remineralization. The fat and protein in cheese and yogurt also help buffer oral acids. On the other hand, acidic foods and drinks (citrus juice, soda, vinegar-based snacks) lower mouth pH directly, independent of bacterial activity.
How Fluoride Changes the Chemistry
Fluoride protects teeth by altering the mineral structure of enamel at the crystal level. When fluoride is present during remineralization, it replaces some of the hydroxyl groups in hydroxyapatite, creating a modified crystal called fluorapatite. Fluoride ions are smaller than the hydroxyl ions they replace, allowing the mineral crystals to pack more tightly. This tighter structure is more stable and requires a greater acid challenge before it begins to dissolve.
There’s also a chemical advantage during acid attacks. When pH drops, the concentration of hydroxyl ions falls dramatically, which destabilizes normal enamel. Fluoride concentrations don’t drop as steeply under the same conditions, so fluorapatite holds together better in an acidic environment. This is why consistent low-level fluoride exposure from toothpaste or drinking water is more effective at preventing cavities than occasional high-dose applications. The fluoride needs to be present at the tooth surface during the constant cycle of mineral loss and repair.
The Overall Timeline
From the first white spot to a cavity that needs a filling, the process typically takes several months to a few years. The speed depends on how often acid attacks occur, how well saliva can recover between them, whether fluoride is present, and the individual’s bacterial profile. In people with very poor oral hygiene or chronic dry mouth, the timeline can compress significantly. In others with strong saliva flow and good dietary habits, early lesions may never progress at all.
The practical takeaway is that cavities are not sudden events but the cumulative result of thousands of small chemical battles on the tooth surface. Each one is winnable, which is why the frequency of brushing, the timing of meals and snacks, and consistent fluoride exposure collectively make more difference than any single factor alone.

