Babies and toddlers can get cavities as soon as teeth erupt in the mouth. This is usually around 6 months of age. Cavities occur when germs in the mouth use sugar and starches from food and drinks to make an acid. The acid weakens tooth enamel. After many acid attacks, a cavity (hole) forms in the tooth. Cavities are an infection and can be painful, making it hard for infants and children to learn and develop normally.