If we look at system at constant temperature and volume which is galvanic cell, first law of thermodynamics states: $$ dU = dQ + dW'$$ Where W' is electrical work exchanged with surroundings and Q is heat exchanged with surroundings. I use chemistry sign convention for work.
As far as I know electrical work is work done by electric field when charge moves between certain potential difference. In galvanic cell, potential difference exists between two electrodes.
Internal energy is sum of total microscopic kinetic energy of all molecules and atoms and their potential energy of interaction (energy stored in intermolecular and chemical bonds).
What does work done by electric field have to do with internal energy of the system? Why does electrical work cause changes in internal energy of the system?
In galvanic cells, electrical work is negative as work is done by the system and from the first law it tends to decrease internal energy of the system.
I can't really see the connection between work done by electric field in the galvanic cell and sum of microscopic kinetic energy and microscopic potential energy of interaction.