I'm not a dentist, but I've had more dental work than I'm happy about and I listened to the explanations. (Advice to kids, not brushing your teeth is a really stupid piece of teenage rebellion. You'll have a lifetime to regret it.)
When you have a cavity, cold things that get into your tooth can set off the nerve and your teeth become sensitive. (If it gets worse you respond to heat as well.) This can be corrected with a filling. There are other causes of sensitivity as well, ask your dentist if you're affected.
When the cavity becomes bad enough that it touches the nerve, the nerve gets infected and you get intense pain. Antibiotics can temporarily help, but now you need a root canal.
If the structure of the tooth is compromised, or if the cavity cannot be operated on (happened to me with a cavity behind my back molar, under the gum - caused by damage from my wisdom teeth), then you need to lose the tooth. If your mouth is in good enough shape then modern dentistry allows them to fill in the hole with powdered cow bone, that will become real bone, into which a post can be driven and a fake tooth created.
Before dentistry, people didn't have any of this. What would happen is that their teeth would get to the point of needing a root canal, and then the pain would quickly become so bad that they'd do anything to make it stop. Anything was typically something like, Tie this string around the tooth, let me tie the other end to a door and slam it. People would start losing teeth around 20, and have lost all of them by 40 or so. Then they'd get dentures.
We still need dentures. But it happens much later in life than it used to. Some people never get them. This is a good thing.
A note about dentists. Dentists go to seminars on how to drum up business. There are a lot of questionable things they do. But if you show up with a mouth full of real problems, the competent ones should be able to prioritize them, coming up with a plan, and progressively fixing just what insurance will cover in each time period. At least that was my experience when I began going to dentists again after I could afford it.