One end of the battery acts like an oxidizer while the other acts like a reducer, and when connected by the electrolytes, the ions can move freely to produce power.
Corrosion is when a metal becomes oxidized. In a battery corrosion can lead to the blocking of passages and stop the ions from traveling through the electrolytes.
Electrolysis is chemical decomposition by passing a electric current through a liquid ions. Some uses for this is, to resist corrosion and improve the appearance of metals like nickel.