Iron pipes lying under acidic soil are often attached to blocks of magnesium for protection from rusting. Magnesium offers protection to iron against corrosion because it