Wow. That’s no fun - sorry to hear that.
Fair warning for this post… your typical disclaimer applies that I don’t have expertise in battery design or charging circuits, so everything here on down is just from my research online and personal experience.
From what I understand, it’s usually related to either a faulty battery or faulty charging mechanism.
That being said, reading through some of the Quora answers linked below, several of the people mention that it’s a potentially hazardous issue to keep using devices in which the battery has started bulging.
Here’s a few snippets from answers on Quora:
Bulging batteries mean only one thing- buildup of gas inside. The gases are produced due to electrochemical oxidation of the electrolyte. Such oxidation occurs usually due to overcharging of the battery due to a faulty battery, or faulty charging electronics in the phone or battery charger.
Source: https://www.quora.com/What-would-cause-a-phone-battery-to-bulge-in-the-middle
and
First of all, if you are using a standard phone charger like the one that came with your phone, this should not happen , no matter how long you leave it on the charger. When a phone reaches 100%, normal chargers stop sending current to your phone.
That being said, if a lithium ion battery is overcharged , that is, too much charge energy is delivered, then it can swell up. Normal Li-ion have a maximum upper voltage of about 4.2-4.3 volts. Your charger should cut off MAX when the battery is in this voltage range, if not sooner.
Source: https://www.quora.com/Why-do-mobile-batteries-swell-up-with-excessive-charging
When lithium-ion batteries are over heated, over charged, or simply failing due to old age, it’s possible for the inner cells of the battery to outgas a flammable electrolyte mixture
Source: https://www.howtogeek.com/244846/what-to-do-when-your-phone-or-laptop-has-a-swollen-battery/
It sounds like the experts are saying this shouldn’t happen in a properly designed and functioning device+charger, but that things do wear down and break over time. I would hazard a guess that means that older devices would be more susceptible to this kind of issue… and that constant charging increases the risk - at least in the case that the preventative overcharging circuitry doesn’t work as expected.
For the first issue related to the age of devices, I guess the only real solution here is to not use older devices which isn’t always practical!
For the second part around constant charging, I’ve seen some people put their tablets onto a smart outlet and only charge the tablet as needed. Either charging it at specific times for a specific duration based on their experience… or getting fancy and using something like Tasker to only trigger the charger when the battery level gets low.