why is energy involved in changes of state