WHY? is our attempt to answer all the questions every little kid asks. Do you have a question? Send it to why@mentalfloss.com.

Your mouth is a busy place. There are hundreds of different kinds of bacteria living on your teeth, tongue and gums. Bacteria, as you may know, are tiny little critters that can only be seen with a microscope. We need some of them to help keep us healthy. Others are more of a pain—especially when they cause cavities (CAA-vih-teez), or little holes in our teeth. If you get a cavity, a dentist will have to treat it. You may get a filling.

During the day, you put all kinds of food into your mouth. When you eat, the bacteria that live in there eat, too. Some bacteria make acid out of the sugar in food. So when you eat sweet stuff—candy, cookies, and sugary drinks—you are helping bacteria to make more acid. The acid eats through the enamel, or the hard coating on your teeth. Over time, this can cause cavities and infections. Ouch! Luckily your spit, or saliva (suh-LIE-vuh), has minerals in it, like calcium and phosphate, that fight back by making your tooth enamel stronger and cutting down on acid. The fluoride in toothpaste helps do this, too. If you have a cavity, a dentist can fill the hole to keep bacteria from getting in and causing a bad infection. Unfortunately, there’s another reason for cavities that you don’t control: genes (jeenz).

Genes are little codes inside our cells that get passed down from our parents. They are instructions to our bodies that affect how we look, act, and grow. Genes may play a big part in whether we get cavities. Some people end up with cavities because of their genes, even if they take really good care of their teeth. Other people hardly get any. We can’t change our genes, but we can control other things. Brushing your teeth, visiting the dentist, and avoiding sweets can all help you keep cavities away.

Want to find out more about what lives inside your mouth? Watch the cartoon below from the National Institutes of Health.