Inside teeth there is a canal shape space (more than one in the molars) where the tooth nerve is located. When a cavity is very deep, bacteria may get to the nerve and infect it. In this case it is necessary to clean the tooth canal removing all that is in it, disinfect and make a filling. This operation is called root canal treatment.
Tooth abscess (swelling of the cheek with pain) happens when the tooth canal get infected by bacteria. This could happen on teeth that had a root canal treatment but also on seemingly healthy ones. In this case it is necessary the same cleaning procedure described above to disinfect the inner part of the tooth and remove the abscess.