system
Given the following post, respond as if you're commenting on Reddit:
human
As a whole, is the Earth gaining or losing heat energy?

When taking into account all sources of heat (solar radiation, radioactive decay, burning of fossil fuels, etc) and all heat loss from radiation into space, is the entire planet (including surface and interior) gaining or losing heat energy?

Edit (quick sub-question): When heat is radiated into space, what is the physical mechanism that is in action? It was my impression that heat can only be transferred by physical interaction between molecules. But since space is literally the absence of molecules (in any significant density), how does heat escape the atmosphere?
gpt
We are overall losing heat. There are a few sources of Earth's internal energy (We'll ignore the processes at the surface here, since compared to the heat of the core, they mean next to nothing):

-Accretion: This is the heat that built up while the planet was forming. It's a result of the collisions of progressively larger particles until planetesimals started smashing into each other. Obviously, this is a pretty significant source of heat hat isn't around today.  
-Differentiation: When we first started out, the Earth was not divided into core, mantle, and crust. The heavier elements sank to the bottom, and this falling motion caused a conversion of potential energy partially into heat energy. This isn't happening today either.  
-Short-term radioactivity: some radioactive elements with relatively short half-lives on the order of 10^5-6 years like ^26 Al create an immense amount of heat, and then shut off. We don't have this heating process today either.  
-Long-term radioactivity: This is the only kind of heating still occurring today, and is considerably less effective than the other three heating methods above. Things like ^238 U have half lives on the order of 10^9 which means that they are still decomposing and heating the planet. However, this process happens so much more slowly that it has a relatively small effect on the overall heat of the planet.

The end result of a lack of heating sources is that the planet is cooling down. The vast majority of this heat is lost as a result of tectonic processes-- the formation of basalts at mid-ocean ridges, and more catastrophic stratovolcanoes like Krakatoa and mount St. Helens. As heat is lost, the lithosphere (the brittle part of the mantle) extends downwards and the mantle "freezes". After a certain amount of time, it will reach the core, and Earth will in essence shut down like Mars and the Moon.