I am confused as to why galvanic cells have electrolytes. For example, a zinc-hydrogen galvanic cell has a zinc sulfate anode electrolyte and hydrochloric acid cathode electrolyte. The overall reaction of this cell is notmay be written as:
$$ \ce{ZnSO4 + HCl -> ZnCl2 + H2SO4} $$$$ \ce{ZnSO4 + 2HCl -> ZnCl2 + H2SO4} $$
RatherBut rather, it is written as:
$$ \ce{Zn(s) + 2H+(aq) -> Zn^2+(aq) + H2(g)} $$
Why is this the overall reaction? What is then the purpose of an electrolyte, if only the anodes and cathodes are written in the overall equation?