Sparks do not per se cause the explosion. Natural gas--for example--is 'dangerous' as regards explosions and sparks provided the concentration is below 5% or above 15%. (I'm going by memory on those figures, so don't try this at home.) It will go boom between those figures.