I know this stack exchange may not be the most appropriate to ask this question and it is better to ask it at chemistry stack exchange. However, I got no satisfying answers there so I figured I'll just ask it here
If we look at system at constant temperature and volume which is galvanic cell (battery), first law of thermodynamics states: $$ dU = dQ + dW'$$
Where W' is electrical work exchanged between galvanic cell and surroundings and Q is heat exchanged with surroundings.
I am using chemistry sign convention for work ,which can be seen in the way first law is written, that is work is positive if surroundings does it on system. In our example, electrical work is going to be negative because we have galvanic cell (battery) which by definition does electrical work on surroundings.
We know that adding heat to the system increases internal energy of the system because it increases mostly average kinetic energy of the molecules. It can also affect average potential energy of interaction (intermolecular and chemical bonds).
What about electrical work in context of galvanic cells? Electrical work is work done by electric field when charge moves certain potential difference. What does that have to do with internal energy changes in context of galvanic cells? With heat exchanged, I do understand how it affects internal energy, but with electrical work I am less sure.
For sake of simplicity we look at galvanic cell working reversibly, so there aren't any losses due to irreversibility. In what way does galvanic cell give work to the surroundings if there is no some electric motor which converts electrical energy to mechanical since electrical work does exist even if there is no any motor which uses electrical energy or current to produce some other form of energy? In case of electric motor it is clear how electrical work is done on surroundings, but without it I don't understand how is it given to surroundings?