Lithium is everywhere these days. As far back as the mid-19th Century, the soft, silver-white metal was medicine. Doctors used it to treat gout as well as psychiatric disorders such as mania. Even today, lithium remains a common treatment for bipolar disorder.

But for many people, lithium has become synonymous with batteries. It is a crucial ingredient for powering your phones, laptops and other portable gadgets. With the rise of hybrid and electric cars, the market for the metal will only grow; as much as three-fold by 2025, according to an estimate by Goldman Sachs.

Most of the world's reserves are in South America, with the single largest deposits under dry lakes in the high Andes. But lithium has been around a lot longer than any mountain or even Earth itself. In fact, lithium is one of the original elements – along with hydrogen and helium – that were born in the Big Bang 13.8 billion years ago.

The history of lithium is long, but also shrouded in mystery. In the aftermath of the Big Bang, most of the newly-created lithium somehow went missing. What's more, when astronomers look at the current Universe, they find extra lithium: about four times more than what should have been produced in the Big Bang.

For more than a decade, scientists have been hunting where this extra lithium came from. Thanks to recent discoveries, however, the search for mysterious cosmic lithium factories may finally be over.

From the oxygen you breathe to the iron in your blood, the vast majority of the elements in your body were forged in the nuclear furnaces of stars. As the astronomer Carl Sagan said, "We are made of star stuff."

The early Universe was a hot soup of plasma

Heavier elements, though, such as the titanium often used in bicycles, require something more violent. Most were produced in nuclear reactions during the explosive deaths of massive stars. Some metals, such as gold, may even have been created in the powerful collisions between neutron stars, the ultra-dense cores of dead stars.

But the most basic elements were made within the first three minutes after the Big Bang. The early Universe was a hot soup of plasma, and as it expanded and cooled, it coagulated mostly into atoms of hydrogen and some helium, the two simplest and most abundant elements, with nuclei made of one and two protons respectively.

The Big Bang also produced traces of a heavy version of hydrogen called deuterium – whose nucleus carries an additional neutron instead of only a proton – and a lighter version of helium, with a nucleus that has one neutron instead of two. Finally, the Big Bang left behind even tinier amounts of lithium.

And that is it. After three minutes, the Universe was cooling too much for any more elements to form.

Even though this happened 13.8 billion years ago, scientists have a good understanding of the nuclear reactions that produced the first elements. Satellites like WMAP and Planck have taken precise measurements of what the early Universe was like, allowing researchers to calculate exactly how much of each element and isotope should have been made.

But when researchers compare their calculations with what they observe, not everything matches. "The deuterium is bang-on," says Brian Fields, an astrophysicist at the University of Illinois in the US. "The helium is looking good. Lithium is the one that's off."

Maybe the explanation is more radical, involving completely new physics

And it is off by a lot. There is three times less lithium than there should be, a discrepancy that has been dubbed "the primordial lithium problem".

Cosmologists first noticed the missing lithium nearly 20 years ago, and they have come up with a host of explanations.

Maybe, scientists hypothesise, some unknown process inside stars destroyed the ancient lithium. Or maybe the explanation is more radical, involving completely new physics. For example, interactions with dark matter, the unknown stuff that is thought to comprise roughly a quarter of the cosmos, might somehow have eliminated lithium in the early Universe.

But while early epochs seem to lack lithium, the current cosmos has a surplus. Astronomers have found relatively abundant amounts of lithium on the surfaces of young stars, which formed relatively recently, as well as in meteors in the Solar System. There is about four times more lithium than what was supposedly made in the Big Bang, enough in the galaxy to weigh as much as 150 suns.

Something, then, must have created this excess lithium and scattered it across the cosmos, where it eventually became incorporated into the nascent Solar System and, billions of years later, into the batteries of your mobile phone. The question is what?

One possibility is cosmic rays: high-energy particles – mostly protons – that whiz around space. As a cosmic ray zooms around, it can crash into stray atoms like oxygen. The collision shatters the oxygen atom into pieces, fragmenting it into a flurry of smaller elements, including lithium.

These milder explosions happen on the surface of a white dwarf

Although this process is likely happening all over the galaxy, Fields says, calculations suggest these collisions account for no more than about 20% of the observed lithium. Another 20% is attributed to the Big Bang, which still leaves 60% without an explanation.

Some of that 60% could be coming from a certain type of star called an asymptotic giant branch (AGB) star. These low- to intermediate-mass stars – no heavier than about 10 suns – are near the end of their lives. The nuclear reactions inside the stars are producing lithium, which can then rise to the surface. But it is unclear how much lithium actually gets expelled and distributed throughout the galaxy.

Then there are stellar explosions called novae. Unlike supernovae, their bigger and more powerful siblings, novae are not directly the result of stellar deaths. These milder explosions happen on the surface of a white dwarf, the Earth-sized corpse of a smaller star like the Sun.

If a white dwarf happens to be in orbit with another star, the white dwarf's gravity can pull hydrogen gas and other material from its partner. Layers of material accumulate on the white dwarf's surface. This drives up temperatures and pressures that eventually trigger thermonuclear fusion – and nuclear reactions that produce lithium.

For decades, no one was able to see any lithium-producing novae in action

Nuclear fusion increases temperatures even more, leading to yet more fusion reactions. Soon, those layers of material blow up in an explosion that appears to Earth as a brightening star: a nova.

The blast launches material – including lithium – into space at speeds of a few thousand kilometres per second. That makes novae much better at dispersing the metal than AGB stars, says Luca Izzo, an astronomer at the Institute of Astrophysics of Andalucia in Spain.

For years, astronomers have been trying to determine which of these three processes – cosmic rays, AGB stars or novae – might produce the most lithium. "We know all of those things definitely make lithium," Fields says. "The question is, do they all contribute exactly equally, or is one really dominating the scene? That has been a very longstanding debate."

When it comes to novae, researchers first recognised them as potential lithium factories nearly 40 years ago. More refined calculations further supported this hypothesis in the mid-1990s, but the research remained entirely theoretical without any corroborating observations. For decades, no one was able to see any lithium-producing novae in action. But then, in early 2015, that changed.

They've managed to capture a nova in action right after it exploded

Armed with new and improved instruments and techniques, two groups of astronomers in Japan and Europe finally detected lithium in novae. Not only does the discovery confirm that novae indeed make lithium, but also that novae make lots of it – potentially enough to account for the majority of the galaxy's lithium.

"The results, at the time I saw them, were quite startling," says Sumner Starrfield, an astrophysicist at Arizona State University and one of the first to study the lithium-producing potential of novae in the late 1970s.

The first reported discovery came in 2015. A team, led by Akito Tajitsu of the National Astronomical Observatory of Japan, found beryllium in a nova. This was a telltale sign that novae are lithium producers, since beryllium decays into lithium.

A few months later, Izzo and his team published a study in which they directly detected lithium in another nova. Early in 2016, Tajitsu's team followed up with the discovery of beryllium in two more novae, including one called V5668. Later that same year, Izzo was part of a team, led by Paolo Molaro of the Astronomical Observatory of Trieste in Italy, that confirmed the detection of beryllium in V5668.

That is a total of four novae with evidence of lithium production, one of which was confirmed by two independent teams. "Experts on spectroscopy are actually getting similar results," says Jordi José, an astrophysicist at the Technical University of Catalonia in Spain. "That starts to say something."

Novae may produce as much as 80% of the non-primordial lithium

"They've managed to capture a nova in action right after it exploded, and they can measure the stuff that's spewing out," Fields says. "And lo and behold, it has tons of lithium."

In fact, Izzo says, the nova that his team observed produces so much lithium that two similar novae per year could create all the observed lithium in the galaxy. That is a preliminary estimate, however, and astronomers will need to study more novae to refine and confirm their measurements.

Still, having any sort of data at all is significant. "With these measurements, we're starting to get ground truth," Fields says. Researchers like Starrfield and José, theorists who have been starved of data for decades, now plan to redo their calculations and models and compare them with the new observations. "Now," José says, "the game begins."

Next, scientists can validate current models of how novae work and determine exactly how much lithium they churn out. Based on previous models, researchers like José estimated that novae could account for half of the lithium that was not made in the Big Bang. But with the new observations, he says, novae may produce as much as 80% of the non-primordial lithium.

Scientists hope to uncover the complete history of this humble metal

To be clear, none of this solves the primordial lithium problem – the mystery as to why the early Universe had so much less of the metal than scientists predicted. But the new discoveries could help.

"As we have a better understanding of the non-primordial processes that make lithium – the way that living and dead stars make lithium – that helps us disentangle the history of lithium in our galaxy, how much it was born with, and at what point the more recent sources of lithium start to enter the picture," Fields says.

Scientists hope to uncover the complete history of this humble metal on which so much technology now depends. Whether from the fiery birth of the cosmos or from nuclear explosions on a dead star on the other side of the galaxy, those lithium atoms have come a long way.

Join over six million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital and Travel, delivered to your inbox every Friday.