Hi,
The swelling can be due to Injury with any kind of hard food while eating or it can be a result of Deep Bite where the lower teeth the continuously hitting the gums just behind the upper teeth, during closing the mouth.
Next Steps
Share picture for further evaluation or visit a nearby dentist