A boat used in salt water will use a sacrificial zinc anode to protect the metal parts from premature corrosion.
Boats berthing at a marina should use a "shore power isolation transformer" while connected to shore power otherwise any boat in the marina with poor or non existent anodes connected to shore power will suck the life from your boat via electrolysis.
Boats used in fresh water use either a sacrificial aluminum or magnesium anode, the domestic hot water tank in your home will also have either type of anode factory installed.
Sacrificial anodes should be checked periodically and replaced as required. And this goes for those of you using heat from your engine to heat water for domestic or other use.
Install the appropriate anode it will add years of life to your engine. Liquid cooled engines often suffer from cylinder liner porosity caused from electrolysis, inhibitor's added to coolant can slow the process.
The list below, the electromotive series of metals, as a precious metals refiner the list is of importance to me.
For instance if I had a multi species liquor and only wanted the precious metals recovered from it then I would use scrap copper. All the metals above copper would be unaffected and remain in solution. Bla Bla Bla.
Each metal on the list above another reacts with all those below it and none above it, having basic knowledge of the series will help you understand galvanic corrosion and how to prevent it.