Most people believe that once you have a cavity, you're stuck with it. But it actually depends on how deep it is. Acid from bacteria in your mouth can cause your tooth to decay.
First, the acid eats away the very hard outer layer of your tooth, called the enamel. Inside the enamel is the dentin. It's spongy and has nerve endings, so your tooth might be sensitive to sweets or cold if the decay reaches there.
The cavity doesn't really start to hurt until it gets through the dentin to the soft pulp. That's when you get a toothache.
Dentists will sometimes fix a cavity by putting in a filling while the decay is still in the enamel. But decay is reversible until it reaches the dentin. If it's properly treated, the decay will stop, and the enamel will harden, although the tooth will never be perfect again.
Dentists can also help by giving you a fluoride treatment, but you have to brush and floss regularly. You might have to give up soda and sweets. It's not easy--and dentists know that. That's why they sometimes fill a cavity in its early stages, before it starts to hurt.
You're not stuck with tooth decay once it happens. But it's better not to let it happen in the first place.