Throughout Earth's history, life has increased greatly in abundance, complexity, and diversity. At the same time, it has substantially altered the Earth's environment, evolving some of its variables to states further and further away from thermodynamic equilibrium. For instance, concentrations in atmospheric oxygen have increased throughout Earth's history, resulting in an increased chemical disequilibrium in the atmosphere as well as an increased redox gradient between the atmosphere and the Earth's reducing crust. These trends seem to contradict the second law of thermodynamics, which states for isolated systems that gradients and free energy are dissipated over time, resulting in a state of thermodynamic equilibrium. This seeming contradiction is resolved by considering planet Earth as a coupled, hierarchical and evolving non-equilibrium thermodynamic system that has been substantially altered by the input of free energy generated by photosynthetic life. Here, I present this hierarchical thermodynamic theory of the Earth system. I first present simple considerations to show that thermodynamic variables are driven away from a state of thermodynamic equilibrium by the transfer of power from some other process and that the resulting state of disequilibrium reflects the past net work done on the variable. This is applied to the processes of planet Earth to characterize the generation and transfer of free energy and its dissipation, from radiative gradients to temperature and chemical potential gradients that result in chemical, kinetic, and potential free energy and associated dynamics of the climate system and geochemical cycles. The maximization of power transfer among the processes within this hierarchy yields thermodynamic efficiencies much lower than the Carnot efficiency of equilibrium thermodynamics and is closely related to the proposed principle of Maximum Entropy Production (MEP). The role of life is then discussed as a photochemical process that generates substantial amounts of chemical free energy which essentially skips the limitations and inefficiencies associated with the transfer of power within the thermodynamic hierarchy of the planet. This perspective allows us to view life as being the means to transform many aspects of planet Earth to states even further away from thermodynamic equilibrium than is possible by purely abiotic means. In this perspective pockets of low-entropy life emerge from the overall trend of the Earth system to increase the entropy of the universe at the fastest possible rate. The implications of the theory are discussed regarding fundamental deficiencies in Earth system modeling, applications of the theory to reconstructions of Earth system history, and regarding the role of human activity for the future of the planet.