Cavities, or tooth decay, is caused by acids eating through your tooth enamel. Those acids come from bacteria in your mouth or from acidic food and drinks in your diet. Cavity causing bacteria metabolize the sugars found in the foods that you eat and produce acid as a by-product. These acids de-mineralize the tooth structure and eventually cause a cavity. Cavities can be prevented by minimizing your consumption of acidic and high-sugar foods, and by brushing and flossing thoroughly to remove food and bacteria-filled plaque from your teeth.