Lubos Motl on why and how energy isn’t conserved in cosmology:
What is energy?
In different physical situations, we use different formulae for “energy” but we always want the “same convertible currency” that may be summarized as follows:
Energy is the scalar quantity that is conserved as a result of the time-translational invariance of the laws of physics.
This deep relationship between symmetries of the laws of Nature – in this case the invariance under the translations in time – and the conservation laws was discovered by Fraulein Emmy Amalie Noether….
Does energy exist in general relativity? Is it nonzero? Is it exactly conserved? Is it approximately conserved? Can it be written as an integral of the energy density over space?
Well, most of these answers are No, at least morally. But let’s look at them more carefully. The precise answers will depend on what you mean by energy and what situation you consider.
General relativity allows the space and time to get curved. So it is no longer the case that the objects are moving in a translationally invariant background. Most backgrounds are not translationally invariant. That’s a reason why Noether’s argument fails in its simplest form.
For example, you may study the evolution of particles and fields – including electromagnetic fields – in the background of an expanding cosmology. I mean the Big Bang cosmology. Because the history of the Big Bang is not invariant under translations in time, Noether’s theorem tells you that the energy of the objects will not be conserved in general.
Read the rest of the (rather long) entry here.