In general, the further apart the materials are in the galvanic series, the higher the risk of galvanic corrosion, which should be prevented by design. Conversely, the farther one metal is from another, the greater the corrosion will be.
Most cathodic and resistant to corrosion to least resistant:
Platinum
Gold
Graphite
Titanium
Silver
Nickel (passive)
Bronzes
Copper
Brasses
Cast iron
Steel or iron
2024 aluminum
Cadmium
Commercially pure aluminium
Zinc
Magnesium and its alloys
For corrosion to occur, three conditions must be present.
1. Two dissimilar metals
2. An electrolyte (water with any type of salt or salts dissolved in it)
3. A metal (conducting) path between the dissimilar metals
Cathodic protection prevents corrosion by converting all of the anodic (active) sites on the metal surface to cathodic (passive) sites by supplying electrical current (or free electrons) from an alternate source and in effect sacrificing
electrons from an alternate source and thereby protecting the underground water pipe etc.
Usually this takes the form of galvanic anodes, which are more active than steel. This practice is also referred to as a sacrificial system, since the galvanic anodes sacrifice themselves to protect the structural steel or pipeline from corrosion.
As long as the current (free electrons) is arriving at the cathode (steel) faster than oxygen is arriving, no corrosion will occur.