A root canal is a capillary, which runs from the base of the root of the tooth to the middle of the crown (the visible part of the tooth). The root canal carries the pulp (a network of blood and nerve cells), which brings the tooth to life.
The nerve of the tooth gets damaged due to many reasons. One of the main causes is cavity in the tooth that grows deeper and touches the nerve. Since the cavity is filled with bacteria, the root canal gets inflamed and causes pain. Other reasons that may damage the teeth are accidental cracks or infection from gums reaching to the base of roots. In such cases, root canal treatments can easily stabilize the position.