It is an electric current flowing through a liquid, stripping metal molecules from one spot and depositing them in a different spot.
The process of electrolysis can discolor, eat holes in, and plug metal components.
Check the system for stray electrical current using a multimeter.
Check the starter for a corroded grounding cable.
A corroded cable on the starter will only introduce stray current while starting the vehicle. This won’t show up on a multimeter test.
Check coolant chemistry. Improper coolant chemistry can accelerate electrolysis (as well as high flow erosion). High iron, salts, or copper contents can greatly increase corrosion. This can typically be remedied by flushing the system and filling with new coolant.