Galvanising is the act of coating iron or steel with a layer of zinc.
The use of zinc in galvanising is an example of a barrier method and sacrificial protection.
As a barrier method, the zinc layer physically acts as a barrier to block oxygen and water from reaching the underlying iron/steel.
In terms of sacrificial protection, even if the zinc coating is scratched or chopped, the iron beneath still does not rust because the surrounding zinc protects it sacrificially.