NASA’s office of Safety and Mission Assurance has revealed the space agency has had at least four explosions—and several close calls—over the past decade due to lithium-ion batteries.

The most recent combustion took place at the Jet Propulsion Lab and eliminated a DARPA RoboSimian droid, which was created for search and rescue missions in high-risk situations. Wired reports the team of scientists replaced the lithium-ion battery for a new one and left the vicinity to allow the new battery to charge. During the charging process, the battery exploded and the droid caught on fire.

Jay Whitacre, a Carnegie Mellon professor of materials science and engineering who used to do battery science at the Jet Propulsion Laboratory, told Wired “a single lithium ion cell is dangerous, but it can’t cause a gigantic explosion.” In the case of the RoboSimian, the droid has not one but 96 cells.

Lithium-ion batteries are notorious for catching on fire. Consider the recent Samsung Galaxy Note 7 debacle—the South Korean company issued a 2.5 million unit recall and ultimately discontinued their flagship product after reports of devices imploding—or last year’s hoverboard crisis where charging gadgets would explode.

What makes lithium-ion batteries susceptible is their structure: they consist of an anode (positive side) and a cathode (negative side) that is separated by a highly flammable liquid electrolyte. Ions from the anode shift to the cathode when the battery is charging and a current runs through the battery. Explosions take place when the current running through a battery while charging does not stop after reaching maximum voltage.

“When you charge a battery, you put a current through it,” said Whitacre. “And you do it until the battery hits its max voltage. When it hits its max voltage, you should stop that current.” If you don’t halt that flow, the battery can fail and, sometimes, explode.

In the case of the recent NASA explosion, overcharging was not the culprit. Instead, Brett Kennedy, head of the RoboSimian project, revealed it was one damaged battery cell that sent incorrect information to the monitoring equipment, causing the cells to overcharge.

“There was a monitoring system in place that continuously monitored the overall battery voltage and current,” he told Wired. “Had either the voltage or current to the battery moved out of specification, the charging would have been shut down.”

For NASA, says the lab’s mishap program manager Lynne Lee, lithium-ion batteries are “an essential part of power.” The batteries power probes that explore space and the spacecrafts that take astronauts outside of Earth. As such, understanding their risks and shortcomings on every scale—whether for a smartphone or spacecraft—is essential.