Lithium-based batteries have been powering our portable devices for 25 years.

But consumer demand for smaller, longer lasting devices is forcing manufacturers to push the technology, battery experts say, testing the limits of how much energy they can safely pack into smaller spaces.

“A battery is really a bomb that releases its energy in a controlled way,” says Qichao Hu, a former researcher at Massachusetts Institute of Technology and founder of SolidEnergy Systems, a battery startup.

“There are fundamental safety issues to all batteries, and as you get to higher energy density and faster charge, the barrier to explosion is less and less.”

On Tuesday, Samsung Electronics scrapped its flagship Note 7 smartphone and told customers return their devices after weeks of bruising reports of phones igniting and images of scorched handsets.

In early September, the world’s largest smartphone maker blamed “a very rare manufacturing process error” for the problems. It has said it is still investigating reports of fires in a second, supposedly safe, batch of phones.

Exactly what caused the problems will be the subject of detailed studies by regulators, the company and its suppliers.

Experts are baffled by what could be causing the overheating in the replacement phones, if not the batteries. Samsung says it would be “premature to speculate” on the outcome of its investigations.

“We are reviewing every step of our engineering, manufacturing and quality control processes,” Samsung said in an emailed response to Reuters.

An official at the Korean Agency for Technology and Standards, which is also investigating, said the fault in the replacement devices might not be the same as the problem in the original product.

Both Samsung SDI and Amperex Technology Ltd (ATL), which supply batteries to Samsung Electronics, declined to comment.

Samsung’s Note 7 crisis may be its biggest, but the problems with lithium-ion are not new.

The U.S. Consumer Product Safety Commission has issued recalls for battery packs, snow blowers, hoverboards, flashlights and power recliners in the past year, all because of fires caused by lithium-ion batteries.

In 2013, Boeing was forced to ground its entire fleet of advanced 787 jetliners after some lithium-ion batteries caught fire. The fleet was allowed to resume flights after changes were made to the battery and charger, and to better contain battery fires.

“We remain confident in the comprehensive improvements made to the 787 battery system following this event, and in the overall performance of the battery system and the safety of the airplane,” Boeing said in 2014 after an investigation into one incident.  

Lithium is the lightest of all metals, and can pack a lot of energy into a small volume – making it perfect for batteries.

The market has grown from a few hundred million cells in 2000 to 8 billion last year, according to Albemarle, a U.S. chemical company.

But for the same reason, lithium-ion batteries need safety mechanisms built in, adding to production costs.

And with prices falling 14 percent per year for the past 15 years, according to Albemarle, smaller scale players have scrimped on safety, says Lewis Larsen, CEO of Lattice Energy, a consultancy.