Prevention of rusting
Galvanizing isn't just a protective coating in the sense that it avoids contact between the iron and the oxidant. Zinc oxidizes more easily than iron, and since both conduct electricity, you can have zinc in contact with the iron anywhere, and it will oxidize first. The term for zinc in this case is "sacrificial anode."

Full coating does help additionally though, by forming a protective layer of zinc oxide. Iron deteriorates when it rusts, so new iron metal is always being exposed as the process continues. However, some metals form oxides that protect the metal underneath from further oxidation. Zinc and aluminum are both examples of these metals.