because of the cavity tooth structure gets loss so food gets stuck inside that space due to gums get swelling. also sometimes due to long-term decay teeth get infected and gums get swollen. you can visit the dentist for check-up and suitable treatment.