Galvanic Corrosion Anodes are used to minimise, or erradicate, corrosion to critical components. The anode is often referred to as a sacraficial one as the principle is that it corrodes intead of the critical component.
In effect, it causes the cylinder to work much like a battery, where the electrolyte provides a means for ion migration from the anode to the cathode. This leads to the anodic metal corroding more quickly than it otherwise would and the corrosion of the cathodic metal is significantly reduce even to the point of stopping altogether.
The presence of an electrolyte and an electronic conducting path between the metals is essential for this galvanic corrosion to occur