To find out the exact reason for the swollen gums you need visit dentist for clinical evaluation and also need to get it done x-ray. there are several possible cause the 1st is it is might related to gum infection which occur as a result of periopocket, the 2nd reason is might the root canal treatment is failed and cause pus formation and swelling. 3rd possible cause is tooth got fractured and cause infection.