The causes of swelling of the gums inside the teeth can be:
general inflammation of the gums (gingivitis, periodontitis);
breakage of the inner part of the tooth;
the exit of the fistula to the lingual side of the gums with inflammation on the tooth root.
For any reason, the sooner you make an appointment with a dentist, the better.