The thermodynamics of the universe is dictated by which form of energy dominates it  relativistic particles which are referred to as radiation, or nonrelativistic particles which are referred to as matter. The former are particles whose rest mass is zero or negligible compared to their energy, and therefore move at the speed of light or very close to it; The latter are particles whose kinetic energy is much lower than their rest mass and therefore move much slower than the speed of light. The intermediate case is not treated well analytically.
Contents 
If the universe is not undergoing a phase transition, one can approximate its thermodynamics by neglecting interactions between particles, and assuming all the energy is in the form of heat. Then by the first law of thermodynamics:
0 = dQ = dU + PdV
Where Q is the total heat which is assumed to be constant, U is the internal energy of the matter and radiation in the universe, P is the pressure and V the volume.
One then finds an equation for the energy density
where in the last equality we used the fact that the total volume of the universe is proportional to a^{3}, a being the scale factor of the universe.
In fact this equation can be directly obtained from the equations of motion governing the FriedmannLemaîtreRobertsonWalker metric: by dividing the equation above with dt and identifying ρ = u (the energy density), we get one of the FLRW equations of motions.
In the comoving coordinates, u is equal to the mass density ρ. For radiation, p = u / 3 whereas for matter p < < u and the pressure can be neglected. Thus we get:
For radiation thus u is proportional to a ^{− 4}
For matter thus u is proportional to a ^{− 3}
This can be understood as follows: For matter, the energy density is equal (in our approximation) to the rest mass density. This is inversly proportional to the volume, and is therefore proportional to a ^{− 3}. For radiation, the energy density depends on the temperature T as well, and is therefore proportional to Ta ^{− 3}. As the universe expands it cools down, so T depends on a as well. In fact, since the energy of a relativistic particle is inversely proportional to its wavelength, which is proportional to a, the energy density of the radiation must be proportional to a ^{− 4}.
From this discussion it is also obvious that the temperature of radiation is inversely proportional to the scale factor a.
Plugging this information to the FriedmannLemaîtreRobertsonWalker equations of motion and neglecting both the cosmological constant Λ and the curvatue parameter k, which is justified for the early universe (a < < 1), one gets the following equation:
ρ = u is the energy density, and one finds the following behavior:
One can further show that the universe was radiationdominated as long as the energy density was of the order of 10 eV to the fourth, or higher. Since the energy density keeps going down, this was no longer true when the universe was 70,000 years old, when it became matter dominant.
In the universe today, matter is mainly in forms of galaxies and dark matter, while the radiation is the cosmic microwave background radiation, the cosmic neutrino background (if the neutrino rest mass is high enough then the latter is formally matter), and finally, mostly in the form of dark energy.
Dark energy is a hypothetical form of energy that permeates all of space, and causes an acceleration in the expansion of the universe due to its strong negative pressure: in general relativity, pressure has a gravitational effect similar to that of energy and mass, and while positive pressure causes gravitational attraction and thus decelerates the expansion of the universe, negative pressure causes gravitational repulsion and thus accelerates the expansion of the universe.
According to the equation above,
Thus the more negative the pressure is, the less the energy density reduces as the universe expands. In other words, Dark energy dilutes less than any other form of energy, and will therefore eventually dominate the universe, as all other energy densities gets diluted faster with the expansion of the universe.
In fact, if the dark energy is created by a cosmological constant or a constant scalar field, then its pressure is minus its energy density p = − u, and therefore its energy density remains constant (as is expected by definition).
Dark energy is usually assumed to be the Casimir energy of the vacuum, with possible contributions from the energy density of scalar fields which has a nonzero value at the vacuum. It may be that this field can decay at some time in the distant future, leading to a new vacuum state, different than the one we are living in. This is a phase transition, where the dark energy is reduced and huge amounts of energy in conventional forms (i.e. particles) are produced.
Such a series of events is in fact thought to have already occurred in the early universe, where first a cosmological constant much larger than the present one came to dominate the universe, bringing about cosmic inflation. At the end of this epoch, a phase transition occurred where the cosmological constant was reduced to its present value and huge amounts of energy where produced, from which all the radiation and matter of the early universe came about.
The thermodynamics of the universe is dictated by which form of energy dominates it  relativistic particles which are referred to as radiation, or nonrelativistic particles which are referred to as matter. The former are particles whose rest mass is zero or negligible compared to their energy, and therefore move at the speed of light or very close to it; The latter are particles whose kinetic energy is much lower than their rest mass and therefore move much slower than the speed of light. The intermediate case is not treated well analytically.
Contents 
If the universe is not undergoing a phase transition, one can approximate its thermodynamics by neglecting interactions between particles, and assuming all the energy is in the form of heat. Then by the first law of thermodynamics:
$0\; =\; dQ\; =\; dU\; +\; P\; dV$
Where $Q$ is the total heat which is assumed to be constant, $U$ is the internal energy of the matter and radiation in the universe, $P$ is the pressure and $V$ the volume.
One then finds an equation for the energy density $u\backslash equiv\; U/V$ $du\; =\; d(\{U\backslash over\; V\})=\{dU\backslash over\; V\}U\{dV\backslash over\; V^2\}=(p+u)\{dV\backslash over\; V\}\; =\; 3(p+u)\{da\backslash over\; a\}$
where in the last equality we used the fact that the total volume of the universe is proportional to $a^3$, $a$ being the scale factor of the universe.
In fact this equation can be directly obtained from the equations of motion governing the FriedmannLemaîtreRobertsonWalker metric: by dividing the equation above with $dt$ and identifying $\backslash rho\; =\; u$ (the energy density), we get one of the FLRW equations of motions.
In the comoving coordinates, $u$ is equal to the mass density $\backslash rho$. For radiation, $p=u/3$ whereas for matter $p<math>\; and\; the\; pressure\; can\; be\; neglected.\; Thus\; we\; get:$
For radiation $du\; =\; 4u\; \{da\backslash over\; a\}$ thus $u$ is proportional to $a^\{4\}$
For matter $du\; =\; 3u\; \{da\backslash over\; a\}$ thus $u$ is proportional to $a^\{3\}$
This can be understood as follows: For matter, the energy density is equal (in our approximation) to the rest mass density. This is inversely proportional to the volume, and is therefore proportional to $a^\{3\}$. For radiation, the energy density depends on the temperature $T$ as well, and is therefore proportional to $T\; a^\{3\}$. As the universe expands it cools down, so $T$ depends on $a$ as well. In fact, since the energy of a relativistic particle is inversely proportional to its wavelength, which is proportional to $a$, the energy density of the radiation must be proportional to $a^\{4\}$.
From this discussion it is also obvious that the temperature of radiation is inversely proportional to the scale factor $a$.
Plugging this information to the FriedmannLemaîtreRobertsonWalker equations of motion and neglecting both the cosmological constant $\backslash Lambda$ and the curvatue parameter $k$, which is justified for the early universe ($a<<1$), one gets the following equation:
$\backslash rho\; =\; u$ is the energy density, and one finds the following behavior:
One can further show that the universe was radiationdominated as long as the energy density was of the order of 10 eV to the fourth, or higher. Since the energy density keeps going down, this was no longer true when the universe was 70,000 years old, when it became matter dominant.
In the universe today, matter is mainly in forms of galaxies and dark matter, while the radiation is the cosmic microwave background radiation, the cosmic neutrino background (if the neutrino rest mass is high enough then the latter is formally matter), and finally, mostly in the form of dark energy.
Dark energy is a hypothetical form of energy that permeates all of space, and causes an acceleration in the expansion of the universe due to its strong negative pressure: in general relativity, pressure has a gravitational effect similar to that of energy and mass, and while positive pressure causes gravitational attraction and thus decelerates the expansion of the universe, negative pressure causes gravitational repulsion and thus accelerates the expansion of the universe.
According to the equation above,
Thus the more negative the pressure is, the less the energy density reduces as the universe expands. In other words, Dark energy dilutes less than any other form of energy, and will therefore eventually dominate the universe, as all other energy densities gets diluted faster with the expansion of the universe.
In fact, if the dark energy is created by a cosmological constant or a constant scalar field, then its pressure is minus its energy density $p\; =\; u$, and therefore its energy density remains constant (as is expected by definition).
Dark energy is usually assumed to be the Casimir energy of the vacuum, with possible contributions from the energy density of scalar fields which has a nonzero value at the vacuum. It may be that this field can decay at some time in the distant future, leading to a new vacuum state, different than the one we are living in. This is a phase transition, where the dark energy is reduced and huge amounts of energy in conventional forms (i.e. particles) are produced.
Such a series of events is in fact thought to have already occurred in the early universe, where first a cosmological constant much larger than the present one came to dominate the universe, bringing about cosmic inflation. At the end of this epoch, a phase transition occurred where the cosmological constant was reduced to its present value and huge amounts of energy where produced, from which all the radiation and matter of the early universe came about.
