As an alternative view, you might observe that the contact with zinc puts iron at an electric potential versus the electrolyte that prevents the attack of iron.
But... I tried once to experiment about it, with aluminium wrap foil alone, or in contact with copper, in a salt solution as concentrated as the Ocean, and in gaseous drinking water as well. The result was that the aluminium, despite being little alloyed to be corrosion-resistant, was punched through within few days, and the contact with copper made no obvious change. So:
- "Aluminium" doesn't resist corrosion. Some special alloys may, under precise conditions.
- The story of electrochemical contacts should be taken with much mistrust.
- Maybe it works when the more corrodible metal is very pure. Indeed, very pure zinc in batteries corrodes little when the user draws no current. A tiny addition of mercury to zinc helped in the past.
- Books forget such circumstances hence are almost always wrong. Never believe books.