What Can Cause Cavities? Bacteria, Sugar, and More

Cavities form when acid eats through the hard outer layer of your teeth, creating small holes that grow over time. About 21% of U.S. adults between 20 and 64 have at least one untreated cavity right now, making tooth decay one of the most common chronic conditions. The process behind it is straightforward, but the list of things that contribute is longer than most people realize.

How a Cavity Actually Forms

Your mouth is home to hundreds of species of bacteria, and they feed on the same carbohydrates you eat. When bacteria break down sugars and starches, they produce acid as a byproduct. That acid lowers the pH on the surface of your teeth, and once the pH drops below about 5.5, the minerals in your enamel (mainly calcium and phosphate) start dissolving. This process is called demineralization.

After you finish eating, your saliva gradually neutralizes the acid and brings those minerals back to the tooth surface, repairing the damage in a process called remineralization. In healthy conditions, a child’s mouth can recover to a near-neutral pH within about 30 minutes. But if the acid attacks happen too often or last too long, the repair can’t keep up with the damage. That’s when a white spot appears on the enamel, the first visible sign of a cavity forming. Left alone, the spot softens into a full hole that penetrates deeper into the tooth.

Sugar, Starch, and Eating Frequency

Sugar is the most well-known culprit, but it’s not the only dietary trigger. Any fermentable carbohydrate, including bread, crackers, chips, and cereal, can feed the bacteria that produce acid. Research comparing starchy foods to sugary ones found something surprising: cooked starches like wheat crackers, potato chips, and corn flakes lingered in the mouth significantly longer than a chocolate candy bar, producing lactic acid for an extended period. Starchy foods tend to stick in the grooves of your teeth and break down slowly, giving bacteria more time to work.

Both the total amount of sugar you eat and how often you eat it matter. The World Health Organization considers both variables important risk factors. Every time you snack, you restart the acid cycle on your teeth. Someone who sips a sugary drink over three hours exposes their teeth to near-constant acid, while someone who drinks the same amount in ten minutes gives their mouth a chance to recover. Frequency and amount tend to rise together in real life, which is why reducing both is the most effective dietary change you can make for your teeth.

The Bacteria Behind the Damage

Not all mouth bacteria cause cavities. The primary driver is Streptococcus mutans, a species that thrives on sugar, produces large amounts of acid, and builds sticky films (biofilms) on tooth surfaces. These biofilms, commonly known as plaque, trap acid against the enamel and create a low-pH environment right where it does the most harm. Lactobacillus species also play a role, particularly once a cavity has already started, because they thrive in the acidic environment of an existing hole and accelerate the damage deeper into the tooth.

You aren’t born with these bacteria. They’re transmitted from other people, typically from a parent or caregiver to a child through shared utensils or close contact during the first few years of life. Once established, these bacteria become a permanent part of your oral community.

Dry Mouth and Reduced Saliva

Saliva is your body’s primary defense against cavities. It washes food particles off your teeth, neutralizes acid, and delivers calcium and phosphate ions back to weakened enamel. When saliva flow drops, that entire defense system slows down, and cavity risk climbs sharply.

Medications are the most common cause of dry mouth. Several drug classes reduce saliva production through different mechanisms. Anticholinergics, frequently prescribed for overactive bladder, cause dry mouth in anywhere from 17% to 54% of users. Tricyclic antidepressants block multiple receptor types involved in saliva production. Blood pressure medications interfere with calcium signaling in the salivary glands. Diuretics alter the water balance in saliva-producing cells. If you take any of these medications long-term, the persistent dryness can transform a low-risk mouth into a high-risk one over months.

Other causes of reduced saliva include radiation therapy to the head or neck, autoimmune conditions that damage salivary glands, chronic mouth breathing, and simple dehydration.

Tooth Shape and Genetics

Some people get more cavities than others even with identical habits, and genetics is part of the reason. Studies estimate that genetic factors account for roughly 17% to 53% of the variation in cavity rates, depending on which tooth surfaces are measured. The genes involved are complex and influence everything from enamel composition and saliva flow rate to immune response against oral bacteria and even taste preferences that shape your diet.

Tooth anatomy matters on a purely physical level too. The chewing surfaces of your molars have pits and fissures, tiny grooves where bacteria and food particles collect. These surfaces show consistently higher cavity rates than smooth tooth surfaces across all age groups and in both baby and adult teeth. People with naturally deeper grooves face a greater risk because toothbrush bristles can’t always reach the bottom of those crevices. This is exactly why dental sealants, thin coatings painted into the grooves, are so effective for children and teenagers.

Nighttime Feeding and Early Childhood Cavities

Babies and toddlers face a specific cavity risk that catches many parents off guard. When a child falls asleep with a bottle of milk, formula, or juice, the liquid pools around the upper front teeth for hours. Saliva flow drops dramatically during sleep, so there’s almost no natural rinsing or acid neutralization happening. The result is a pattern of rapid, severe decay on the front teeth known as nursing caries.

Milk contains lactose, a sugar that was long considered harmless to teeth. But prolonged contact between milk and the tooth surface, the kind that happens when a child nurses a bottle overnight, creates enough sustained acid to demineralize enamel. The lower front teeth are usually spared because the tongue covers them and the nearby salivary glands provide some protection. The upper front teeth and the first baby molars take the worst damage. The same risk applies to sippy cups filled with juice or sweetened drinks that a toddler carries around throughout the day.

Fluoride and Why It Matters

Fluoride protects teeth by changing the mineral structure of enamel. Your enamel is made of a mineral called hydroxyapatite, which dissolves relatively easily in acid. When fluoride is present, it gets incorporated into the enamel crystal and converts it to fluorapatite, a harder mineral that resists acid at a lower pH. This means your teeth can withstand more acid exposure before demineralization begins.

Fluoride also helps with remineralization. When calcium and phosphate from saliva are rebuilding a weakened spot on your enamel, fluoride speeds up the process and makes the repaired enamel stronger than the original. This is why fluoride toothpaste, fluoridated water, and professional fluoride treatments all reduce cavity rates. Conversely, people who avoid fluoride remove one of the most effective layers of protection their teeth have.

Other Contributing Factors

Acid reflux brings stomach acid into your mouth, eroding enamel from the inside out. People with frequent heartburn or gastroesophageal reflux disease often show unusual patterns of enamel wear on the back surfaces of their teeth, and this thinned enamel is more vulnerable to bacterial acid on top of it.

Braces and dental appliances create areas that are difficult to clean, trapping plaque against the tooth surface for weeks or months. Receding gums expose the root surfaces of teeth, which lack the thick enamel coating that protects the crown and decay more easily. Eating disorders involving vomiting cause direct acid damage to enamel, particularly on the inner surfaces of the upper teeth.

Even age plays a role in shifting patterns. About 10% of adolescents have untreated cavities in their permanent teeth, while among adults over 65, the rate is around 13%, often driven by gum recession and dry mouth from medications rather than the sugar-heavy diets that drive decay in younger people.