As a battery engineer ()...that's almost certainly because the chemical reaction that runs your battery is having problems.
To put it simply, unexpected reactions are happening instead of the usual charge-discharge, which causes gas to be generated as the materials in your battery degrade. If you have a rigid shell and your battery starts malfunctioning, then you basically have an extremely high pressure, very flammable bomb inside your laptop. The true design choice, rather than the swelling itself, is the soft shell around the battery which allows you to (a) visually notice the malfunction and replace the battery and (b) relieves the pressure on the battery until you do.
First time I've gotten to use my graduate degree to explain something on these boards! Sweet!