A cavity, is a bacterial infection that causes demineralization and destruction of the enamel, dentin and cementum, usually by production of acid by bacterial fermentation of the food debris accumulated on the tooth surface.
Eating the right foods, washing your mouth with water, chewing on sugar-free gum, etc. are some ways you can prevent dental cavities.
You shouldn’t wait for pain to treat a dental cavity as once the decay reaches the second layer, i.e. the dentin, it progresses faster and you may experience sensitivity in the tooth. To prevent more damage to the tooth you will need to get it filled. Failure to do so will cause the decay to spread to pulp, the innermost layer of the tooth with nerves and blood vessels. You may or may not experience pain at this stage. When the pulp gets infected just filling the tooth is not an option! Your tooth can be fixed only with a root canal treatment (RCT) followed by a restoration of the tooth with a crown. And in some case, you may not be lucky enough. The tooth may become beyond repair needing it to be extracted. The infection from the pulp may also spread to the periodontal ligament (fibres that attach tooth to the bone) leading to its destruction and ultimately, loss of teeth.