Zinc being oxidised provides most of the energy for what is happening.
I'm an electronics designer and programmer, not a chemist.
It's down to "Electronegativity" and such if I remember correctly, but I cannot tell you the exact chemistry and reactions etc.
I've had no need for such stuff since leaving school roughly 50 years ago.
It may be something like "partial pressure" or an equivalent of that with different atoms in the electrolyte.
(If an excess of something is produced at one point, it will be pushed away from there, even against other forces, until an equilibrium is found).
I cannot answer any further than that. Other people no doubt can, but you may be better asking on a chemistry forum rather than electronics.
It's not relevant either work or hobby wise to me; electronics, computers, hydraulics, music, audio & radio, machine tools & various other technology related subjects, yes - but not chemistry.