Tooth decay is caused by certain types of bacteria that live in your mouth. When they stick to the film on your teeth called dental plaque, they can do damage. The bacteria feed on what you eat and drink, especially sugars (including fruit sugars) and cooked starches (bread, potatoes, rice, pasta, etc.). Within approximately 5 minutes after you eat, or drink, the bacteria begin making acids as they digest your food. Those acids can break into the outer surface of the tooth and melt away some of the minerals.
Your saliva can balance the acid attacks if they don’t happen very often. However, if: 1) your mouth is dry, 2) you have a lot of these bacteria, or 3) you snack frequently, then acid causes loss of tooth minerals. This is the start of tooth decay and leads to cavities.