Rechargeable lithium batteries are more susceptible to overheating than other types of batteries if they are exposed to high temperatures, are damaged or have manufacturing flaws. Once the overheating starts, it can lead to "thermal runaway"
The science behind phone battery fires is actually pretty simple, and fairly well understood. Much like the infamous exploding hoverboards, phones use lithium ion battery packs for their power, and it just so happens that the liquid swimming around inside most lithium ion batteries is highly flammable.
If the battery short-circuits
It heats up the (flammable!) liquid electrolyte at that spot. And if the liquid heats up quickly enough, the battery can explode.