Medieval people did not get cavities at nearly the rate that do modern people in the West. On the other hand, their teeth were worn down a lot.
Cavities, as your dentist will tell you, are directly linked to sugar and sugary foods. The medieval diet (on which see more here) had very little sugar. They had honey, but it was not used very much. After all, honey means bees, so you either have to find wild honey in the woods (and avoid getting stung) or keep bees, which is a lot of work and takes away from time spent raising grain.
Without soft drinks, without sugary snacks, without frosted flakes, even without the currants that started attacking teeth in the early modern period, a person in the Middle Ages would get very few cavities, as archaeology has shown. They would not have the perfectly aligned, pure white teeth of modern orthodontia, but they were pretty good for people without toothbrushes or fluoride toothpaste. (One could and did clean one's teeth with a twig.)
And yet many teeth were worn down by medieval bread. Starting in the eleventh and twelfth centuries, most grain was ground by big millstones, powered either by wind or water. These replaced the old hand mills, something closer to a mortar and pestle.
It would take one person essentially all day, doing nothing else, to grind enough grain into flour in a hand mill to make enough bread for a family for one day. Back in Roman times, a slave or two would do the grinding. With wind mills and water mills, however, unknown to the Romans, one could grind a 50-pound bag of wheat into a 50-pound bag of flour in fifteen minutes. Not surprisingly, this technology spread very rapidly and was adopted nearly everywhere.
But mills grind grain by rotating two big millstones against each other, with the grain in between, and what emerges is both flour and stone dust. The stone dust would be baked into bread along with the flour. Stone dust passes through the digestive tract without any problem, but it first wears down the teeth, not a lot with each bite, but the effect builds up over time.
Archaeologists can tell when a particular community adopted mills and millstones by looking for wear on skeletons' teeth.