This question has occupied me for a while and I think one can dare to take a first approach by first looking at the theoretical initial and final state of the closed, thermodynamic system “Earth”…
The common theory of the formation of terrestrial planets (planetary bodies) shows that the Earth was much hotter in its early days than it is today.A distinction is made between three different energy/heat sources:
(1) During the accretion of a planet, first potential graviatation energy is converted into kinetic energy and then the kinetic energy of the colliding bodies and particles into thermal energy (heat); this results in most of the energy originally stored in a more planetary body.
(2) Also, a large amount of thermal energy is released during the differentiation of a planetary body by the conversion of potential gravitational energy; the resulting energy is small compared to the accretion energy.
The upper limit of the energy resulting from these two sources can be estimated when the mass, radius, and core radius of the body are known.
(3) During the decay of radioactive nuclides, mass energy (stored in the atomic nuclei) is converted into thermal energy; the original concentration of radioactive elements determines the maximum possible resulting amount of energy.
After finished accretion (100% of today’s mass reached) and differentiation (nuclear formation completed), the system “Earth/planetary body” begins to aim for a thermal equilibrium with its environment, the interplanetary space, and therefore cools down ( heat always flows in the direction of the medium with lower temperature).
In addition to the decay of radioactive elements, there are three other potential heat sources that counteract the cooling of a planetary body (tidal friction, inductive heat production, crystallization heat), but nevertheless the body cools down inevitably, as each of these heat sources loses intensity over time.
It can be assumed that the Earth will be completely solidified in its equilibrium/final state, and that the dominant process on the way between the beginning and the end state must therefore be crystallization.
It is basically not relevant whether the final state is actually reached. It is only relevant that the total trope must increase in the course of each small development step, since in the thermodynamic sense every natural, spontaneously running process is characterized by an increase/maximization of entropy.
Since the ‘Earth’ system interacts with its environment, the entropy of the environment must be included and the total trope S_g must be understood as the sum of the entropy of the system S_s and the entropy of the environment S_u
S_g = S_s + S_u
Changes in the total trope dS_g are formulated accordingly as
dS_g = dS_s + dS_u
Entropy S can be described by the number of possible particle configurations P of the system and is then generally formulated as
S = kB lnP (kB: Boltzmann constant)
It is now obvious that the number of possible particle configurations of a substance decreases from the gaseous to the solid state.Thus, the entropy of a system decreases as a result of the crystallization of a liquid phase (dS_s < 0). At the same time, however, crystallization takes place in general. under the release of heat (crystallization heat), which leads to a heating of the environment and thus to an increase in the entropy of the environment (dS_u > 0); we are talking about an exothermic process. Exothermic processes are also characterized by the decrease in the free energy of the system (the minimization of free energy/Gibbsian energy is the second side effect of a spontaneously occurring natural process).
However, in order for the process of crystallization to take place spontaneously, the entropy of the system’s environment must increase to a greater extent as the entropy of the system decreases (dS_u > dS_s, so that dS_g > 0 continues to apply).Thermal equilibrium arises when entropy cannot continue to increase and dS_g = 0 becomes more important.
It can therefore be said that the entropy of the ‘Earth’ system decreases, while at the same time the entropy of the (Earth) environment increases to a greater extent.
P.S.: the approach is the simplest I can imagine and hopefully correct in its basic features.For deeper insights, I recommend ‘R. Kjellander, Thermodynamics Kept Simple: A Molecular Approach’. His examples are very intuitive and the thermodynamic concepts are well formulated.