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 slow tug-of-war between mineral loss and mineral repair that plays out every time you eat or drink. When the balance tips toward loss often enough and long enough, the result is a hole in your tooth.
How Acid Dissolves Your Teeth
Your tooth enamel is about 96% mineral by weight, mostly a crystalline structure called hydroxyapatite. It’s the hardest tissue in your body, but it has a specific vulnerability: acid. When the pH on a tooth’s surface drops below roughly 5.5, the acid begins pulling calcium and phosphate ions out of the enamel crystals. This process is called demineralization.
The chemistry works two ways. Acid ions directly bind to phosphate in the enamel, loosening it from the crystal structure. Certain acids, particularly those from fruit and soft drinks, also form complexes that strip calcium away in bundles, causing broader mineral loss in a single reaction. Phosphoric acid, commonly found in cola, attacks through both pathways at once.
A single acid exposure doesn’t create a cavity. Your mouth naturally recovers. The problem starts when acid attacks happen frequently throughout the day, giving your teeth less and less time to repair between rounds.
The Bacteria Behind the Acid
Your mouth hosts hundreds of bacterial species, but a relative handful drive tooth decay. The most important is Streptococcus mutans, a bacterium that thrives in dental plaque, the sticky film that builds up on teeth between brushings. S. mutans feeds on sugars in your food, and its waste product is acid. It’s also unusually tolerant of acidic environments, meaning it keeps producing acid even after conditions become hostile to other bacteria.
Other species contribute too. Various streptococci and acid-producing bacteria form a complex community within plaque. The biofilm structure of plaque is part of the problem: it traps acid against the tooth surface and shields bacteria from saliva, which would otherwise wash them away and neutralize the acid.
Sugar, Starch, and What You Eat
Not all foods fuel cavities equally. Sucrose, ordinary table sugar, is the most cavity-promoting carbohydrate. Bacteria metabolize it efficiently and produce a sharp drop in oral pH. But sucrose isn’t the only culprit. Any fermentable carbohydrate, including glucose, fructose, and cooked starches, can feed the process.
Raw starch has relatively low cavity-causing potential. Cooking changes the picture: cooked starch is roughly one-third to one-half as damaging as sucrose. Combining sugar and starch together, think cookies, pastries, or sweetened cereals, may be more harmful than sugar alone, likely because starchy foods stick to teeth and extend the time bacteria have access to fuel.
Frequency matters as much as quantity. Sipping a sugary drink over two hours causes far more damage than drinking the same amount in five minutes, because each sip restarts the acid cycle. The World Health Organization notes that keeping free sugar intake below 10% of total daily calories is associated with lower rates of decay, and dropping below roughly 5% shows even further benefit.
Your Saliva Fights Back
Saliva is your primary natural defense against cavities, and it works in several ways at once. First, it physically rinses food particles and bacteria off your teeth. Second, it contains three buffer systems, with the bicarbonate system being the most important, that neutralize acids and bring oral pH back to safe levels after eating. Third, and perhaps most critically, saliva is supersaturated with calcium and phosphate ions at normal pH. These minerals can redeposit into weakened enamel, literally rebuilding what acid removed.
Certain proteins in saliva also help. Some bind directly to enamel surfaces and increase local calcium concentration, promoting repair. Others form a thin protective film called pellicle on your teeth. Calcium phosphate embedded in this pellicle is about ten times more soluble than the mineral in your actual tooth, so when acid strikes, the pellicle dissolves first, acting as a sacrificial shield.
This is why anything that reduces saliva flow dramatically increases cavity risk.
Dry Mouth and Medication Risks
Hundreds of commonly prescribed medications list dry mouth as a side effect, and many of them are taken daily for years. Antidepressants, blood pressure medications, antihistamines, diuretics, muscle relaxants, sedatives, and opioid painkillers all reduce saliva production in at least 10% of people who take them. If you’re on multiple medications from these categories, the effect compounds.
Medical conditions can also dry out your mouth. Sjögren’s syndrome, an autoimmune condition that targets moisture-producing glands, is the most well-known cause. But poorly controlled diabetes, rheumatoid arthritis, thyroid disease, end-stage kidney disease, and HIV/AIDS can all reduce saliva flow. Radiation therapy to the head or neck often damages salivary glands permanently. Even chronic mouth breathing from allergies or sleep apnea reduces the protective saliva coating on your teeth.
People with dry mouth can go from having few cavities to developing them rapidly, sometimes along the gum line or on tooth surfaces that rarely decay in people with normal saliva flow.
Genetics and Enamel Quality
Some people inherit enamel that’s structurally weaker from the start. Dozens of genes influence how enamel forms during childhood, coding for everything from the structural proteins that scaffold crystal growth to the enzymes that clear away soft tissue so minerals can pack in tightly, to the calcium transport channels that deliver raw materials to developing teeth.
When these genes carry mutations, the result is either enamel that’s too thin (hypoplasia) or enamel that’s normal thickness but poorly mineralized (hypomineralization), or some combination of both. These hereditary conditions, collectively called amelogenesis imperfecta, vary widely in severity. Some people simply have slightly softer enamel that wears and decays more easily. Others have visibly pitted or discolored teeth from birth.
Even without a diagnosed condition, natural variation in enamel density and tooth shape means some people are genuinely more cavity-prone than others, independent of diet or hygiene habits.
How a Cavity Develops Over Time
Cavities don’t appear overnight. The first visible sign is a white spot on the enamel, an area where minerals have been lost but the surface hasn’t broken down yet. At this stage, the damage is reversible. With better hygiene, reduced sugar exposure, and adequate fluoride, the enamel can remineralize and the white spot can fade.
If demineralization continues, the white spot may darken to brown as the enamel weakens further. Eventually the surface breaks, creating an actual hole. Once a cavity has physically formed, it can’t heal on its own and needs to be filled. Left untreated, decay moves through the enamel into the softer dentin layer underneath (which starts dissolving at a higher pH of about 6.0, making it more vulnerable), then potentially into the pulp where nerves and blood vessels live. At that point, you’re looking at infection, abscess, or tooth loss.
How Fluoride Tips the Balance
Fluoride works because of a simple physical property: a fluoride ion is smaller than the hydroxyl ion it replaces in tooth mineral. When fluoride incorporates into enamel, it allows the mineral crystals to pack more tightly, increasing the attractive forces between ions and making the whole structure more stable. The resulting mineral, fluorapatite, requires a lower pH to dissolve than regular enamel. In practical terms, your teeth can withstand more acid before minerals start leaching out.
Fluoride also participates directly in remineralization. Saliva needs calcium, phosphate, and fluoride together to most effectively rebuild weakened enamel. This is why fluoride toothpaste helps even after your teeth are fully formed: it’s not just about building stronger enamel during childhood, but about helping your saliva do a better repair job every single day.
Why Some People Get More Cavities
Cavity risk isn’t one thing. It’s the intersection of bacterial load, diet, saliva quality, enamel genetics, and habits. Someone with genetically strong enamel, robust saliva flow, and a low-sugar diet can get away with imperfect brushing. Someone on antidepressants with naturally thin enamel who snacks frequently may develop cavities despite diligent oral care.
The factors you can control are the ones that matter most for prevention: reducing how often sugars and refined starches contact your teeth, disrupting plaque through regular brushing and flossing, maintaining fluoride exposure through toothpaste or treated water, and staying hydrated to support saliva production. If you take medications that cause dry mouth, sugar-free gum or saliva substitutes can partially compensate for what your glands aren’t providing.