Similar to a bone, the tooth has a "hard shell", but a "soft core": the pulp or simply the "nerve". If the nerve inflames or has died, it has to be removed. After adequate disinfection, the canal system is permanently filled with a suitable material and sealed.
The goal of such a root canal treatment is the preservation of the natural tooth.