Root canal treatment (endodontic treatment) is required when you have a tooth infection. When you have an infection, your body sends white blood cells and antibodies to the infected area to kill the bacteria. The tissue becomes red and swells. When you have an infection in your tooth, there is no room in the canal space for extra antibodies or white blood cells. When the tissue attempts to swell, it chokes itself and dies, and then it becomes a perpetual source of infection, called a tooth abscess, spilling into the bone tissue around the end of the tooth.
In endodontic treatment, the dentist removes this dead or diseased tissue, cleans the inside of the tooth thoroughly, and then places a sealer material inside the tooth. It's important that the tooth be filled to the very end of the apex of the tooth.
This treatment is generally not difficult for the patient, and pain after root canal is often not a large issue, in spite of its reputation. In my experience as a dentist, a tooth extraction appointment was the most traumatic for the patient, by far. Many of these appointments were very easy, and with some, we didn't even need novocain to keep the patient comfortable because the tooth was dead and had no feeling in it. Yet some people are so afraid of endodontic treatment that they choose to have a tooth extracted instead, which ends up being much more stressful for them than if they had the dentist save the tooth.