I always understood that metals close to each other in the electromotive series are more compatible than those further apart.
Li, K, Ba, Ca, Na, Mg, Al, Zn, Fe, Cd, Ni, Sn, Pb, H, Cu, Hg, Ag, Au
The more reactive metals are on the left. In a galvanic cell, they will deposit salts on the more noble metals to the right
This is why copper coated MIG welding wire rusts if used for any other purpose, while galvanised steel lasts for years.
Some chemical engineer will now show me where I am wrong. (like, hydrogen is a metal?)
Jeff