Tooth decay is an infective disease of the hard tissues of the teeth. Everybody has bacteria in their mouth all of the time. When you eat sugar, the bacteria convert the sugar into acid. This acid attacks the teeth and begins to soften them (demineralisation). The spit in your mouth is able to repair this damage, but only if there are long periods during the day when there is no sugar in the mouth. Over a period of time, frequent acid attacks form infected holes in the teeth that then need filling.
The teeth can cope with a maximum of four sugar attacks a day before they start decaying (forming holes). That is why it is important to eat sugary foods/drinks with a meal and stick to sugar free alternatives in-between meals.
Pain is not a reliable guide to how bad your teeth are. Sometimes patients with no cavities get a lot of pain, and sometimes we see patients with large holes in the teeth and no pain at all.
As a general rule, decay does not hurt much in the early stages but as the hole gets bigger and closer to the nerve of the tooth then pain and or infection can occur.
To prevent pain and infection visit your dentist regularly. They will screen for decay and detect and fill holes before they become painful.