Galvanizing protects the base metal
It forms a coating of zinc which, when intact, prevents corrosive substances from reaching the underlying steel or iron.
The zinc serves as a sacrificial anode so that even if the coating is scratched, the exposed steel will still be protected by the remaining zinc.
The zinc protects its base metal by corroding before iron. For better results, application of chromates over zinc is also seen as an industrial trend.