Eating. Tonsil stones (i.e. Tonsilliths) are collections of food and debris which get trapped in the tonsils. This material gets infected usually becomes foul smelling. Some tonsils have more nooks and crannies in which to collect this debris, which makes the stones larger and/or more numerous. If removed, tonsilliths usually will recur. If severe, tonsillectomy will cure the problem. Best wishes.
Bacteria. Tonsil stones are benign firm white "stones" that form in the tonsil crypts from bacteria... Much like plaque on your teeth. They are not dangerous, but can contribute to bad breath.