This sounds really interesting, can you explain it further for a layman? (Not being snarky, I genuinely know very little about chemistry)
"They are made from a metal alloy with a more "active" voltage (more negative reduction potential / more positive electrochemical potential) than the metal of the structure. The difference in potential between the two metals means that the galvanic anode corrodes, so that the anode material is consumed in preference to the structure." https://en.wikipedia.org/wiki/Galvanic_anode
The trouble was that they're pretty expensive, and zinc has a great resale value - so we had to do extra watches around the lower decks with rigged firehoses to try and stop local divers stealing them who knew we'd just come out of drydock. (This was in the Philippines). We lost several that way.