Cavities are formed due to acid production in the mouth over a period of time. When foods with carbohydrates like bread, cereal, milk, soda, fruit, cake, or candy stay on your teeth. The bacteria in your mouth turn them into acids. The bacteria, acid, food debris, and your saliva combine to form plaque, which clings to the teeth. The acids in plaque dissolve the enamel, creating holes called cavities. This can be further exasperated when people eat these sorts of foods frequently throughout the day. It has been shown that frequency of sugar substances is much worse for teeth than quantity. People whom are frequently exposing their teeth to acid will have a higher caries rate that those whom consume these foods in one sitting regardless of the quantity. I recommend to my patients whom drink soda or eat candy to consume these products in one sitting, regardless of the amount they consume. It is much better to drink a whole 2L of soda within one sitting than to sip the soda throughout the day because than you are constantly exposing your teeth to acid.