Galvanic isolators consist of two diodes internally, connected in anti-parallel fashion. When connected this way, the diodes allow current in both directions but only above a certain threshold voltage. The voltage at which diodes conduct is about 1.4 Vdc.
An isolator is installed directly behind your boat’s 230V connection. The forward voltage from the galvanic isolator is higher than the potential difference between metals. As a result, this voltage will not allow conduction and as such prevents any electrolytic current. However, if there is a (higher) error voltage in the AC circuit, the diodes will allow current through and the residual-current device breaks the circuit.