As just said above, corrosion has many many forms. Galvanic and stray are both concerns of boaters but they are generated differently.
Galvanic is when two dissimilar metals come in contact within an electrolyte. Sea water is highly conductive due to its salt content. You ward off Galvanic corrosion by placing more "active" metals within the circuit. Zinc anodes are an example, sometimes called sacrificial anodes because they seem to dissolve over time.
For example on outboard motors. The Zinc dissolves to protect the Aluminum housing and prop and the steel shafts and internal gearing.
It also could be as simple as a drop of salt water in an engine compartment bridging the gap between a bolt and its mating member. A salt water free engine is a happy engine.
Stray current is caused by current flow local sources, other boats, docks etc....