In a vast majority of cases, tonsillitis is cause by a viral infection (i.e. due to a virus). Certain bacteria can also cause tonsillitis and Streptococcal bacteria have been found to be the culprit in some cases. These are the same bacteria that cause streptococcal throat infection. Tonsillitis can rarely be caused by fungus or parasites also.
A number of food substances can lead to tonsillitis in susceptible individuals and common triggers include foods with artificial colors and preservatives, peanuts, cold foods, cold drinks, ice creams, sour foods, etc. The possible mechanism may be triggering of an abnormal immune response on exposure to any of these substances which acts as an allergen.
Episodes of tonsillitis can also be triggered by environmental changes though the exact mechanism has not been clearly understood. Changes of weather, extremely cold climate, damp weather, exposure to a lot of pollution, etc. can all trigger an episode of tonsillitis.
Tonsillitis can easily spread from one person to another via droplet infection. When a person with tonsillitis coughs or sneezes, the infection is dispersed in the air in the form of minute droplets which when inhaled by a healthy individual can lead to infection. These droplets can also settle on certain objects (e.g. handkerchief, telephone receiver, door handles, etc.) and when these objects come in contact with the nose, mouth or eyes of a healthy individual, the infection can get transmitted.
Crowded places such as shopping malls, theatres, classrooms, etc. form a fertile ground for the infections to thrive and spread further to more and more people.
Thus there are multiple factors that work together in conjunction to cause tonsillitis in any given case.