A battery, typically copper, has two terminals, one positive, one negative. When a piece of metal wire connects the two ends, a current of electrons travels through the wire, creating electricity.
The process involves also traveling through an electrolyte, helping to transfer the electrons.
As one side of the battery oxidizes, the opposing end begins to reduce. These electrons must transfer to the opposing end of the wire. This occurs over and over.
Batteries corrode similarly to other metals, because they are comprised of metals. However, corrosion is sometimes caused by a leak in the battery allowing battery acid to leave the terminal.