
The energy talked about here is internal energy of the system. The system which does work loses energy from its system as the energy gets transferred to the system on which the work was done. So the internal energy of system on which the work was done increases.