a normal alkaline battery has a vent feature on it. A over pressure vent that makes it leak electrolyte rather then exploding. At least so it does not rupture violently.
Sleezy manufacturers get rid of this vent, which allows the cell to explode. Of course, it won't leak until it does. The idea is not to get sprayed with hot electrolyte. Its supposed to have a fairly low pressure burst disk type feature.
One engineering approach is to try to get rid of gas build up with chemistry, the off brand approach is to make a bomb. I think thats why you see zinc carbon low cost cells included with some low cost products, rather then off brand similar capacity to name brand alkaline, which don't have the chemical engineering used to try to make them reliable with a burst disk. They don't want the liability (its bad for your face)
Or it could have been a QC over sight (i.e. vent not formed properly, wrong part used, obstruction (bad crimp or debris), I imagine they might have little room to work on in AAA batteries, so if you over crimp, you could say... crush the 'burst slot' or whatever feature you have on the battery, greatly increasing the 'vent pressure'.
The 9V battery uses AAAA cells or very similar. You hardly have any room in there for anything, meaning even if you engineer it right, your manufacturing needs to be precise. No worn dies, jigs, alignment features, etc. Combine the precision requirement with low cost high volume and suddenly it turns out you just can't make the thing as cheap as you think you can. Then combine that with the requirements for maintaining your electroplating baths and other cell manufacturing shit and you got extra gas being formed from corrosion
i imagine its a slew of tricks used to get it to not leak in the package when its stored 5 years past expiration date too in a warehouse before relabling
if you take a good look at the cell, you will see there is only one place to put a pressure vent. you have to be precise. It means putting money into manufacturing, regularly. It also means R&D inventions are very welcome to make this process easier.. I don't think the alkaline battery is anywhere near its full engineering potential for manufacturability and quality, as old as it is
and the 9V battery is a unique opportunity, to use grab bin of whatever AAAA is available. mystery enchilada. You might get 5 sticks of ground beef and 1 stick of off brand spam in your baking tray if someone feels like making a dollar