Lead-acid batteries are made up of plates of lead and separate plates of lead oxide, these are submerged into and electrolyte solution of about 35% sulphuric acid and 65% water. This causes a chemical reaction that releases electrons, allowing them to flow through conductors to product electricity.
Batteries are designed to operate at or around a fully charged state and the job of the alternator is to keep the battery at this level.
Battery failure is mainly caused by the failure of the alternator to recharge the battery sufficiently or by the battery being unable to hold the charge that the alternator has generated for it. This can be because of a drain on the battery, such as lights being left on or it can be because the battery is old and past it’s useful life.