How do electric batteries work, and what affects their properties?