Total energy = KE + P.E. + Thermal Energy +
Electrical Potential energy + ...
Energy is said to be the capacity to do work.
Generally work is done by physical movement of a body. Hence, the
kinetic energy is involved. When any potential energy changes, that is
converted usually into the kinetic energy.
Usually, moving object does work. Hence the decrease or
increase in the kinetic energy is the amount of work done by the body or the
external agent (force) respectively. Other components of energy remains
same. Other energies convert to kinetic energy and kinetic energy
Work is done when a force moves (or slows down) a body
through a distance. Then kinetic energy is changed. Also, work is
done when a gas expands or compresses varying in pressure and volume.
When a spring is compressed, there is work done, but by movement of some
object or absorbing kinetic energy of an agent.