Tooth enamel, made of calcium phosphate does not dissolve in water, but it is corroded when pH is below 5.5 (acidic).
Bacteria present in the mouth produce acids by degradation of sugar and food particles remaining in the mouth. It can be prevented by using tooth paste, which is generally basic to neutralise excess acid