Batteries generate hydrogen
you could have a minor explosion if it is ignited. The problem is the
acid and shrapnel thrown around. It is rare, but happens. Can
be caused by one or more cells being low on water and when starting it
internally. Also as the others have said, a cracked or badly corroded
letting the gas out and causing a spark.
This is why jumping a battery should be done carefully. One blew up in my Dads face and his 20-20 vision went to 20-100 or so. I do positive to positive on the batteries and then the ground cable to the engine in both cars, not the battery. So no sparks near the battery when connecting the ground last or disconnecting the ground first.
My brother blew up a battery in a stock car by moving the car with the battery charger attached and plugged in. When the clamp fell off it caused a spark. We also had a rubber boot around the battery for roll-over protection. It caused the hydrogen to accumulate also. BOOM it blew the top off the battery. The fun thing was he did the exact same thing again a week later.
good jack stands, never cheap ones. Good wide bases, sturdy
construction and put in a good supporting location under the car.
I don't go
under a car without a jack stand under it. I've had a floor jack
blow a seal, but the car stopped when it hit the
jack stand, not me. It is best to have the weight on the
jack stands to begin with. I even try to push the car off the
stands as a check for security. You don't want it falling off
when you are wrenching on the car.