TL;DR: The repair specialists over at iFixit have put together an informative video detailing the risks associated with lithium ion batteries and how to mitigate the chances of something going wrong.
Reports of exploding batteries in mobile electronics like smartphones aren't all that uncommon and often occur when the battery gets punctured. This creates a short circuit between the positive and negative layers, providing a path for all of the energy stored in the battery to flow through. Things can quickly heat up and if it gets hot enough, the electrolytes in the battery can decompose into flammable vapors that catch fire.
You may recall Samsung's Galaxy Note 7 fiasco back in 2016. Shortly after launching its new flagship, the Korean handset maker recalled the phone due to what it believed was faulty batteries that could overheat and catch fire. Sammy replaced the first wave of phones with models featuring batteries believed to be safe, but reports of fires continued. Samsung ended up permanently ceasing production of the Note 7 in October 2016.
iFixit's first tip is to discharge the battery in the device you are working with to minimize the potential energy it is storing. The team also recommends working with plastic spudgers instead of metal tools as they are not electrically conductive.
It also goes without saying that size matters. That is, big batteries like those used in laptops have the potential to cause far more damage than smaller packs that power smartphones. Again, by discharging the battery first, you'll greatly minimize the odds of a catastrophe.
If it's worth doing, it's worth overdoing. To conclude their PSA, iFixit took a nail gun to a battery that was 100 times bigger than a standard smartphone battery... you know, for science. Sure enough, puncturing it resulted in an impressive blaze.
With the right precautions and safety gear in place, working with lithium ion batteries isn't all that risky. Still, when in doubt, it's best to leave it to the professionals and take your device to a reputable service provider for repair.
Image credit: Kilian Seiler