Why Does Electrical Work Cause Changes in Internal Energy of the System? 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 done by galvanic cell and Q is heat exchanged with surroundings.
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.
If water is electrolyzed producing $\ce{H2}$ and $\ce{O2}$ gases, a great amount of energy has to be added to this water. The obtained substances are not hotter than the original water. But they possess a much higher potential energy. Their internal energy (and enthalpy, and free enthalpy) is much higher than the same atoms in water. This internal energy may be liberated into heat if these substances are sent in a flame, or into electric energy in a combustion cell.
It is no use thinking about the work done by an electric field on an electron in the atoms. The electric field inside an atom is difficult to calculate, because of all other electrons interfering with the field of the nucleus inside the atom.