Come 2021, if all goes as planned, Los Angeles will have the biggest battery in the world.

It will be made up of 18,000 lithium-ion battery packs — each roughly the size of what you'd find in the Nissan Leaf — with a total capacity of 100 megawatts (MW). That's enough to power roughly 600,000 homes. This so-called Alamitos battery, being built by AES Energy Storage, is, in many ways, the future.

Many of the ways we generate power today, like coal and nuclear, can't be switched on or off easily. Simply based on how they work, it takes awhile to get the necessary heat going to generate the steam and run the turbines. So we produce too much power at night and not enough during peak-usage times in the afternoon. Plus, power is hard to store in massive quantities — we use it as we make it — so we rely on specially designed "peaker" plants, usually run off natural gas, to fill in the gaps.

Gigantic batteries could solve this problem. They'd charge up when electricity is cheap and demand is low, then release extra power when demand is high. That would smooth everything out: Electricity prices would be less erratic, we'd use electricity more efficiently, and we'd burn less fossil fuels.

Green power sources like wind and solar can also be intermittent and unpredictable: You don't know when the wind will blow or clouds will roll in, and of course there's day and night to contend with. So if we're going to use green power on a society-wide basis, energy storage will have to be society-wide too.

A battery is really just a chemical device for storing ions in one place when they want to go to another place. Whether a battery is lithium-ion or lead-acid or nickel-metal denotes what sort of chemical materials are used, but the process is the same. At Alamitos, when all those lithium-ion battery packs discharge, the ions will flow from where they're stored to where they want to go, which will generate electric current. Then, when those battery packs are charging up on cheap electricity, that will shove the ions back to where they were stored, ready to be discharged again.

But you don't technically have to have fancy chemical setups to do this. The same basic energy storage principles can be applied in far more blunt mechanical ways. (These technically aren't considered batteries, but the ideas behind them are similar.)

Instead of a chemical battery, for instance, you could use your periods of cheap excess electricity to pump compressed air underground. Then, when demand is high and you need more electricity than you're generating, you could release the air to drive turbines, creating energy. That's what a power plant built in Huntorf, Germany, in 1978 does — producing something between 290 and 321 MW.

You can also use giant mirror arrays to concentrate sunlight on a material — usually a form of salt — and heat it to over 1,000 degrees Fahrenheit. Then you use the molten salt to generate steam and drive a turbine. The salt obviously doesn't stay hot forever, but it lasts the night until the sun comes up again to reheat it. The result is a solar-powered facility that can generate electricity 24/7.

The 280 MW Solana solar farm near Phoenix works this way. So does the 360 MW Pedro de Valdivia facility in Chile.

You can also use flywheels — massive disks housed in near-frictionless environments, which are spun up in periods of cheap electricity. Their momentum is then used to generate extra electricity during peak demand.

Now, a lot of these systems are actually storage-and-power-plant combos. Solana, for instance, is basically a solar power plant that uses a storage system to smooth out its operation. Many of the compressed air systems are connected to natural gas plants, and the compressed air is used to spin the turbines when the natural-gas-heated steam isn't being used. Or both are used at once.

Then there's the Bath County Hydro Pumped Storage facility on the border of Virginia and West Virginia. It's literally just two giant water reservoirs, one at a higher elevation than the other. When energy demand is low, cheap electricity is used to pump water up to the higher elevation. When demand goes up in peak hours, the water is released to flow back down to the lower reservoir, driving a set of turbines as it goes. The result is a whopping 3 gigawatt facility that has been helping supply the power needs of 60 million people in 13 states for 30 years.

In the future, if we want to use the electricity we produce more efficiently, we're going to need more energy storage. If we're going to switch the world to renewables like wind and solar, we're going to need a lot more.

But it won't just be fancy chemical devices. The world of batteries is far bigger and weirder and more creative than that. And it will require batteries in all their forms to build that better, greener world.