A root canal clears bacteria and damaged tissue to save a tooth and relieve pain, whereas a filling restores the function and cosmetic appearance of teeth.