After having meals, a sticky layer will be formed on the tooth. It's called a plaque. When you eat something, the bacteria in the plaque will undergo anaerobic respiration and will turn the sugar in your food into acid. The other layer of tooth, enamel, may be corroded by the acid formed. When the enamel is corroded, the dentine and pulp cavity will be exposed, and bacteria may get into it and attack them. That's how tooth decay is formed.