Put two different metals in contact with a bit of moisture and you've built a battery — the less-noble metal corrodes to protect the nobler one. It's the most common avoidable corrosion failure in assemblies.
The galvanic series
Metals rank by electrochemical potential. Near the noble (cathodic) end: gold, graphite, stainless (passive), titanium, nickel. Near the active (anodic) end: magnesium, zinc, aluminium, carbon steel. The farther apart two metals sit, the stronger the driving voltage when they touch in an electrolyte — and the anodic (more active) one corrodes.
The three ingredients
Galvanic corrosion needs all three: dissimilar metals, electrical contact, and an electrolyte (even humidity or salt spray). Remove any one and it stops. Watch the area ratio: a small anode next to a large cathode corrodes fast (a steel fastener in an aluminium plate is fine; an aluminium fastener in steel is not).
How to stop it
Choose metals close together in the series. Isolate them — non-conductive washers, sleeves, gaskets, paint or a coating between them. Seal out the electrolyte. Add a sacrificial anode (zinc) that corrodes first. Or make the fastener the noble/large member. Aerospace uses MIL-STD-889 to judge which couples are acceptable.
Other forms to watch
Crevice and pitting corrosion (stagnant, oxygen-starved gaps — even in stainless), and stress-corrosion cracking (tension + a corrosive environment) are related failure modes worth designing against with drainage, sealed crevices and the right alloy.