Tooth erosion plays a role in the development of cavities. Erosion due to acidic foods and drinks, certain medicines, or stomach acids will eat away at the outer enamel of teeth, creating openings for bacteria and acid to enter.