A battery stores up to 1000 Watt-days when there is more power produced than used, and provides power from its storage to appliances if power generated is not enough.
Batteries are a staple of any colony's energy system. Their primary use is to cushion the highs and lows produced from wind and solar power, so that your base can stay online at all times. Batteries can be used in a pinch as emergency backups in case raiders destroy your power plant or main supply line, and a few batteries can be regularly used to supply power through the night for solar power. Many batteries can even keep a base running through an eclipse, but this is generally not recommended as it is more useful to keep a stable energy supply through Wind turbines and Geothermal generators.
Batteries are high voltage components and require a direct power line to the grid to function. When connected they will automatically charge up from the grid's excess energy, and automatically release energy when it is needed. Batteries charge at 50% efficiency and in addition have a peak charging rate that takes about a full day to charge from empty. A quick rule of thumb is if your maximum energy surplus is twice as large as your worst energy deficit then things are pretty good.
When raining, uncovered batteries with a charge have a high chance of catching fire and exploding. Nearby fire, or NPC's on fire will also cause explosions. Batteries can also malfunction if exposed to high temperatures so be sure to keep them cool during a heat wave.
Batteries can short circuit through an event, causing all of the stored energy to explode at a random point along your power grid. More energy will create a larger explosion, which can be devastating if a large number of batteries discharge at once. Mitigate this damage by creating separate battery networks using Power switches. Disconnect the batteries when charged, and only connect the batteries when they are needed (such as immediately after the other batteries short out).