The batteries that our smartphones currently use (and the majority of electronic devices too) and contain inflammable components. They are lithium batteries, both Li-ion and Li-Po. All batteries have a cathode and an anode (positive and negative), a substance which reduces and gives out electrons and another which oxidizes and collects them. This transfer is used to provide the smartphone with energy.
In all batteries, the cathode and the anode are separated by a membrane. If the cathode and the anode touch each other then they react chemically, and in the case of lithium batteries that reaction is very quick. It isn’t an explosion, but rather a very quick combustion. Luckily the battery doesn’t have sufficient fuel to explode violently but it will cause damage to anything within a radius of half a meter.