The bacteria causing tooth decay and cavities, also known as "Streptococcus mutans", has been evolving. According to researchers who extracted the bacteria from human teeth from the Bronze Age S mutans has been mutating rapidly. The study of the bacteria is done in hopes of understanding it to the point of predicting its future behavior and thus ultimately using this information to combat its advance.
How S. mutans works is it metabolizes the sugars in food and produces lactic acid. This acid eats away at the teeth's enamel surface causing dental problems such as cavities. Cavities, themselves, have been around far before humans, being found in African gorillas 2 million years ago. And aside from evolving, the bacteria has also increased in numbers significantly following mankind's shift from hunting to agriculture, foods heavy in carbohydrates and thus sugar.
Researchers studied its evolution to see if the bacteria increased in its ability to cause disease. They found that it has evolved neutrally, a result of random genetic mutation, and hasn't given the bacteria any special advantages on human hosts. But S. mutans has become more diverse as the human population grew, with more forms than ever before. Researchers continue to study the bacteria and are looking into what changes it went through as Europeans moved into North America. One thing remains clear: limit your intake of sugar, and you will limit your chances of developing tooth rot and cavities.