A battery is a device that stores chemical energy and converts it to electrical energy on demand. It consists of two electrodes, a separator, an electrolyte, and some sort of casing.
Connecting a load to the electrodes starts a chemical reaction that causes electrons to flow from the negatively charged electrode to the positively charged electrode. The electrical energy released may light up a flashlight, start a car, or run a portable computer.
Battery energy is measured in watt hours (Whr) and expresses how long the battery can sustain a given power output. Energy density, expressed in Whr/kg or Whr/l, is determined by electrode material, physics, and engineering practicalities. Key electrode properties include reaction efficiency, energy output, conductivity, safety, cost, and processibility.
Besides energy density, batteries are characterized by voltage, operating life, storage life, self-discharge, safety, ease of manufacture, output power, and cost. Unfortunately, optimizing one characteristic may come at the expense of another. For example, increasing output power often tends to reduce overall operating life.