We discuss the evolution of the universe in the context of the second law of thermodynamics from its early stages to the far future. Cosmological observations suggest that most matter and radiation will be absorbed by the cosmological horizon. On the local scale, the matter that is not ejected from our supercluster will collapse to a supermassive black hole and then slowly evaporate. The history of the universe is that of an approach to the equilibrium state of the gravitational field.