A battery never works better than the very first time you charge it up. It’s in their nature: They store energy for us, but they do so less efficiently each time we recharge them.

Not that there aren’t things we can do to keep batteries holding their charge better, as experts like Venkat Srinivasan are happy to advise. “Don’t use your laptop like a desktop,” he says. “When it’s fully charged, pull the plug. The battery’s already charged, and we still insist on charging more and more.”

As he said that, I couldn’t help but glance down nervously at the laptop onto which I was furiously transcribing his words. Of course it was plugged in. Of course it had been like that since at least yesterday, and of course what was once at least a couple hours of battery life was now probably at most an unplugged half-hour. Hopefully Srinivasan couldn’t tell my poor battery management just from talking with me.

Srinivasan is one of the chief researchers exploring the science of batteries at Argonne National Laboratory, located a half-hour southwest of Chicago. He knows all the tricks to keep a phone or laptop battery from losing its ability to hold a charge. The main secret, he says, is to never actually charge your device all the way up.

“The best thing you can do is go up to 70 percent or 80 percent charged, not go above that, and sort of stay in that range,” he says. The reason for this advice lies in the chemical structure of the lithium-ion battery that powers most consumer electronics and, increasingly, electric vehicles. The acts of charging and discharging a battery can cause its materials to expand and contract, placing the entire battery under stress and shortening its lifespan.

If you let a phone battery run until it goes dead and then charge it all the way back up to 100 percent, it might have only a few hundred cycles before it stops working. Someone absurdly committed to keeping a battery’s swings tiny — say between 75 and 78 percent — could wring out up to 300,000 cycles, according to Srinivasan’s calculations.

Srinivasan admits that sort of precise battery management is almost certainly going to be more trouble than it’s worth for most people, so he recommends a simpler approach to keep batteries holding their charge.

Beyond the structural concerns, why is it so damaging to a battery to keep it fully charged, or even just to charge it all the way up?

The answer lies in the unforgiving, volatile microscopic environments within these portable powerhouses. From their very first charge, batteries are fighting a losing battle with their own chemistry.

Rechargeable batteries like those in a phone or laptop generate electrical current from the movement between electrodes of charged particles, or ions, of the element lithium — that’s why we call them lithium-ion batteries.

When a battery is discharging, the particles move from the negative electrode to the positive electrode, also known as the anode and cathode, respectively. The process reverses during charging. In lithium-ion batteries, the anode is generally made from an electrically conducting carbon compound like graphite, while the cathode is made from a lithium-based compound that can absorb and release the lithium ions.

Here’s where the problem starts if, say, a phone is left plugged in all night. The ions react with the cathode in a chemical process called oxidation, which consumes some of the battery’s lithium. The longer these reactions occur, the more particles needed to sustain the battery’s current are lost. It doesn’t take as long to discharge the particles, which means the battery runs empty much more quickly than it used to. The problem can worsen if the battery is charged at too fast a rate, which also saps its capacity.

Batteries face perils beyond overcharging, as the chemical environment inexorably degrades even if you are always perfectly attentive to when to unplug your phone.

“With the lithium ions, some of them get lost,” explained materials scientist Michael Toney, a researcher at the SLAC National Accelerator Laboratory, near Stanford University. “They get stuck in places where they’re not able to shuttle back between the anode and cathode anymore. Parts of the anode or cathode get electronically disconnected from the current collector. That’s the part of the battery that collects electrons that runs back and forth as you charge and discharge the battery.”

The lithium ions travel between the electrodes through liquid chemicals called electrolytes. Those electrolytes are essential to the whole operation, but they also undergo reactions with the anode that shorten the battery’s lifespan.

“Nature, unfortunately, wants to get that reaction to occur, so it will occur,” said Srinivasan. All battery designers can do is try to keep that reaction to a minimum. “But it’s not perfect. It comes back to bite you.”

Still, as finicky as lithium-ion batteries can be, most people probably aren’t going to notice too much of a problem, simply because they don’t keep their phone or laptop long enough for the charging situation to become genuinely dire. There might be an almost subconscious resignation that, yep, it’s time to just give up and use your laptop as a permanently plugged-in desktop, or a vague sense that your phone doesn’t seem to have nearly the battery life that was advertised. But unless you’re planning on keeping your electronics much beyond three years, it won’t be that big a deal.

But what about electric cars, which run on much bigger versions of similar lithium-ion batteries? Most people who shell out more than $70,000 for a Tesla car are going to want that battery to hold a charge for several years, perhaps even a decade or longer. If anything, electric vehicles present unique problems in managing the charge that household electronics don’t.

“Typically, if you stomp on the accelerator, you want the car to respond appropriately,” said Toney. “So that can drive the battery very hard for a short period of time. That’s not typically the kind of discharges you will see in a laptop or a cellphone.”

Beyond regular use, all batteries are sensitive to fluctuating temperature, with some phone or laptop batteries programmed to shut off automatically if they get too hot. A Tesla battery, roughly the equivalent of 8,000 cellphone batteries, can get much hotter during use. And it’s possible the charging station will be in a cool location, creating a potentially dangerous temperature swing.

There’s also the issue of how quickly an electric vehicle needs to charge. For now, many electric car drivers are content with charging their vehicle overnight, which means the car battery can regain a charge at a safe, slow rate. But any future electric car infrastructure is going to need the equivalent of gas stations—places where drivers can refuel on long trips.

“Ideally we’d like electric vehicles to charge up in closer to 15 minutes, which is at the point you imagine someone pulling into a recharging station, going to the bathroom, getting a drink, and it’s charged up ready to go,” said Toney. “That uses a lot of power, and batteries aren’t capable of handling that yet. They won’t charge to full capacity. If you try to recharge your battery at that kind of rate, it will fail fast.”

The lithium-ion battery is a remarkable invention, helping to power technological revolutions in how we use computers, phones, and eventually cars. But the same internal chemistry that makes them so ideal to power our indispensable devices also means their time is inherently limited.

Getting batteries to hold a charge longer is one of the many fundamental issues battery scientists are looking to grapple with, whether that means improving the setup that already exists or creating something new and better.

While we wait, consider following Srinivasan’s advice: “At least don’t leave your laptop plugged in!” At least for those of us who haven’t already completely ruined our computer’s battery life, that is.