Ear ringing is medically referred to as tinnitus. It is not a disease but rather a symptom that can be caused by a variety of factors such as exposure to loud noise, allergies or changes in blood pressure to name a few. In some people it is far more severe and may be permanent, but many people experience it like yourself – randomly and infrequently.
You will be more aware of it in a quiet environment so it may happen more often but you are not aware of it due to surrounding noise. Tinnitus is fairly common. There was an interesting study done by Heller and Bergman (1953) where 100 ‘tinnitus free’ students were placed in an anechoic chamber (a room which gives little or no reflection of sound due to special treating on the walls, floors and celings which cause them to absorb sound). It was found that 93 per cent of these students reported buzzing, pulsing and whistling sounds. So you are not alone.
Rik Sargent, Science Museum