What is tooth enamel chemically ? State the condition when it starts corroding

What is tooth enamel chemically ? State the condition when it starts corroding. What happens when food particles left in the mouth after eating degrades? Why do doctors suggest use of tooth powder/toothpaste to prevent tooth decay?
Or
Tooth enamel is one of the hardest substances in our body. How does it undergo damage due to the eating of chocolates and sweets ? What should we do to prevent it?

White tooth enamel is calcium phosphate though a very hard substance, which gets affected when the pH of our mouth falls below 5.5.
It happens because the bacteria present in our mouth break down sugar and food particles into acids which damage our teeth by corroding them. To prevent the tooth decay, after eating one should clean mouth thoroughly with tooth powder or toothpaste, which is basic in nature. It neutralises the excess of acid.