An exploding phone seems like a freak accident, but the same chemical properties that make batteries work also make them likely to catch fire. Samsung is learning this the hard way, as it becomes the latest company to recall a device — in this case, its new Galaxy Note 7 phone — because the batteries could be dangerous.

When batteries explode, it’s often the failure of manufacturers to make sure no explosion will happen. Exploding batteries can be the consequence of overeager companies pushing technology to the limit. As our screens gets bigger and phones more powerful, they need more energy, but most of us are unwilling to give up battery life or charging speed.

We’ve already achieved almost 90 percent of the maximum battery life theoretically possible from the lithium-ion battery, according to Lynden Archer, a materials scientist at Cornell University, so manufacturers are pushing the limits more and more to eke out only a little bit more energy. "There’s been a bit of an arms race where every manufacturer of a smartphone wants to get the highest battery life," he says. "This trend in the field is producing more and more of a tendency for overcharging so all these models of failure are becoming more commonplace."

Samsung blames the Galaxy Note recall on the fact that, in some devices, two parts of the battery that should not have touched came together. But there are many common ways for rechargeable lithium-ion batteries to break, and this usually happens because we keep demanding more from the devices. (Lithium-ion batteries are the type used in almost all smartphones and electronics. Engineers use lithium because it’s light and can hold a lot of energy.)

As we reported earlier, Samsung has stressed that reports of problematic batteries account for less than 0.1 percent of the entire volume sold; but there’s no doubt that this global recall is more than just a minor snafu for the consumer electronics giant. The Note 7 launched just a few weeks ago and was met with mostly positive reviews, including our own.

More importantly, Samsung managed to make waves in the smartphone market weeks before Apple launched its highly anticipated new iPhone. Now, Samsung’s successful launch has been marred by exploding batteries.

To understand what makes a battery safe, it’s helpful to know how they work. There are two electrodes, or electrical conductors, on opposite sides. One electrode holds positively charged ions and is called the cathode. The cathode is filled with lithium and that is where the "fuel" is stored. The opposite electrode holds negatively charged ions and is called the anode.

During charging, lithium ions move from the cathode to the anode. When the battery is in use, the lithium moves in the opposite direction. In between are chemicals called electrolytes that conduct the current by helping ions move more easily between the two sides. But even though ions need to move from side to side, the anode and the cathode themselves should never touch because they’ll redirect energy to the electrolytes. To prevent this from happening, battery makers insert separators in between.

Batteries can fail when they’re charged too much or too fast

That’s what went wrong with the Galaxy Note 7: the separators were flawed and let the two electrodes touch. "This is considered the worst possible failure because it will most certainly lead to fire and possibly even an explosion," says Archer. When the electrodes come into contact, all the energy being pumped into the battery goes directly to the electrolytes in the middle instead of in the electrodes on the side.

Electrolytes aren’t very stable to begin with and the quick movement they facilitate also leads to instability. When there’s a lot of heat — whether through the two electrodes touching, or something as simple as it being too hot outside — it can make the electrolyte react with the other chemicals and create gas in a way that releases even more heat. Each time the chemicals react, the gases release more and more heat at a faster and faster rate. This creates an uncontrolled positive feedback loop called "thermal runaway," which can end in a fire.

This is why many phones shut down automatically when it’s hot. But there are other ways that batteries become explosive. They can also fail when they’re charged too much, or too fast.

Overcharging is like filling up a bucket with too much water. It doesn’t matter how slowly you go because if you pour in too much, the bucket will overflow. In the case of batteries, overcharging happens when too much lithium goes into the anode. This isn’t something you risk from keeping your phone plugged in all night — most batteries are designed to automatically prevent overcharging. Rather, it’s a manufacturer defect that can happen when the circuitry that prevents this from happening is faulty.

The battery is like a rubber band, says Dan Steingart, a materials scientist at Princeton University. When you’re charging the battery, you’re stretching the rubber band; when you’re using it, you’re releasing it. Just like a rubber band can break if you stretch it too much, putting too much energy into one side will ruin the battery.

Some scientists are developing a kind of electrolyte that won’t burst into flames

Then there’s the problem of going too fast. This means trying to drive too much current into the battery, which is a danger for the so-called "fast-charging technology." (Though they weren’t the issue here, Samsung does offer fast-charging tech.) If the charger is incompatible with the battery for any reason, the battery can also short out. This can be avoided by making sure the charger and the battery are meant to work together.

Charging too much or too fast can lead to a problem called "plating." Think of the battery like two egg crates. Lithium ions need to shuttle between the spaces in the two egg plates to be safely deposited inside, says Steingart. If you charge the battery slowly, the lithium has time to find its spot in the egg crate as it goes back and forth. But go too quickly or have too much, and lithium will just deposit itself on the outside of the egg crate and then onto itself. Then, each time you recharge, the lithium builds on itself and forms needle-like structures called dendrites that can internally short out the battery.

The last common source of failure happens when companies try to make batteries store more power by increasing voltage. Voltage is a way to measure force. Think of voltage like the height of a waterfall, while current is like the amount of water flowing. The higher the voltage, the more power there is in the battery, so manufacturers try to pump this up by adding elements like nickel to the lithium. But — again — the higher the voltage is, the more likely the electrolytes are to combine in a way that makes them catch fire.

Some scientists are trying to develop a kind of electrolyte that won’t burst into flames as easily. These electrolytes, called "ionic liquids," need a lot more heat to form flammable gas, says Surya Moganty, a chemical engineer who is the chief technology officer of Nohms Technology. These are often much safer, but there can be challenges with battery life, he says.

Until we get there though, most of us are stuck with lithium-ion batteries. The very fact that these work is an "engineering marvel," says Steingart, but that doesn’t take away from the instability of the devices. "Anything that can hold this much energy and you can potentially get all the energy out in a couple minutes you should treat like a potential bomb regardless of what it’s made out of," he adds. Battery tech is continually advancing, but not at the rate of our desire for faster charging and longer battery life — and it’s up to the manufacturers to remember this, and protect us from what we want.

This story was originally published on September 8, 2016 and has been updated to include video.