Take a piece of iron and a zinc metal dip it in saltwater connect a wire between the iron and the zinc. A current will start flowing through the wire that can be measured with a voltmeter. The zinc will show signs of corrosion. When one uses dissimilar metals in saltwater and the metals are connected through a conductor there is always galvanic corrosion! When designing and analyzing this corrosion problem one can refer to charts called galvanic series. Metals are labeled from noble metals (least reactive) to anodic metals (most reactive) in other words showing corrosion. The further the metals are apart on the chart the greater the voltage potential between them and the faster the corrosion, on the anodic metal. Here are links to charts with explanations!
Electrolysis is, inducing a DC current through a conductor to split water into hydrogen gas and oxygen gas. Stray electrical currents, voltage leakage from electrical systems can induce electrolysis and corrosion failure. On an old boat that may be most difficult to find. One usually recognizes this problem if the zincs get used up very fast or one specific zinc. To mitigate expensive repair, inspect your zincs at regular intervals.
Note! Aluminum boats are susceptible to these kind of corrosion for aluminum is active on the galvanic scale. Just need an uninsulated or chafed wire touching the hull! It will get interesting!
The principle of electrolysis is also used to protect ships. The process is called impressed current cathodic protection. want to know more, click the link!