Many factors influence teeth and can cause them to get cavities.A primary factor is diet. The formation of cavities is a continuous process in which teeth are "demineralized" or weakened. This occurs as a result of acid in the mouth. Two main sources are acidic foods like lemons, apple juice or soda