Or a spark of some sort....
You didn't mention what type of battery you had that exploded, but if they are the older flooded type of batteries they create hydrogen and oxygen when they are being charged. Since they often aren't closed cell, they vent these gases to the space around the batteries. If this is the case, even a 4% hydrogen concentration is enough to cause an explosion if there is a spark present. Think about the zepellins that were hydrogen filled, you get the picture?When I was younger, I did some work with a prevention of blindness group and they showed videos of folks who were trying to charge car batteries that exploded, showering them with sulfuric acid, not a pretty site, and a common cause of blindness and disfigurment. Things have gotten better over the years, and you don't hear about it happening as much now.Anyway, check to see if this might have been a contributor to problem. Sparks on boats are not a good thing. If you can isolate them you won't be surprisedd in the future. Also, you do need to ventilate flooded cell batteries as a matter of course.Geof