If it happens on a mooring
and it is agressive electrolysis
there is the possibility that a wiring
problem is allowing the 12 volt battery
voltage to get to underwater metal.
A bad connection in the negative wiring
could be passing part of the current
through the water
on the way back to the battery
. All connections, particularly in everything connected to 12 volts negative circuit should be checked.
A fairly easy check is to measure the voltage between the battery negative terminal and every piece of underwater metal while turning assiciated DC items on and off. Those measurements should be less than 10 millivilts. If you find one considerably higher, check the ground connections to that device, or if no device you could try bonding it to the battery negative.
Any items that connect both to the 12 volts and have underwater metal suche as a depth sounder
should be checked. You would disconnect the underwater metal and re-connect the ground wire through an amp meter. If you measure more than a few thousandths of an amp the device could be contributing to the problem. If disconnecting and measuring the current
is not feasible, you can measure the current flow on the posititive supply with the device OFF (which often will not be zero). Then disconnect the cable to the underwater part and see if the measurement changes. If it decreases that would indicate how much current is going into the water.
If you measured those voltages with shore power
connected a galvanic isolator
would be highly advised. For $100 it is a first line of defense.