We often say motor produces work. But in reality, the motor does not give us any work if electrical energy is not supplied to it. Similarly, electricity is generated by losing some mechanical or thermal energy. The net change of the internal energy of the system and surroundings is zero.
The change of internal energy is independent of the path or way of transformation but heat change and work done are dependent on the path of transformation. For example, when the element zinc reacts with copper sulfate in solution, a considerable quantity of heat is produced. But if the same redox reaction takes place in the voltaic cell practically no heat evolved and the internal energy converted into electric work.
If oxidation of the mixture of gasoline or burnt gasoline is in the air the large quantity of heat is produced. But if the same change is carried out in the engine, the combustion pushes out the piston and performs work. Here engine produces a Lasser quantity of heat than the oxidizing process. Therefore the magnitude and work done very with the condition of the experiment in thermodynamics energy conservation.