It is sometimes said that a system will settle into the state with lowest potential energy. In reality it tends to end up in a macrostate with highest entropy.

Consider the simple pendulum. It is constantly accelarated downwards because of gravity, but once it reaches the bottom it will keep swinging forever. Once you factor in friction and air resistance, then it will settle at the bottom. Why?

If there are two systems that exchange energy, the total energy is conserved, and the total entropy will be maximized. For each unit of energy added, the entropy of a system will change by a certain amount, depending on its temperature. So the two systems will keep exchanging energy until they have the optimal split of energy with the most total entropy, at which point the two systems have the same temperature.

For a system of \(n\) harmonic oscillators, the energy is \(nkT/2\) and the temperature is \(kT\). So for a single pendulum with 1 joule of energy, the temperature is \(1.5*10^{23}\) K. No wonder energy tends to dissipate in simple systems!

But, as it loses energy to the surrounding air, its temperature will decrease. Eventually the oscillations of the pendulum will be so small that the entire pendulum will have similar energy to a single air molecule, and the pendulum will not slow down further. This is related to Brownian motion.

Pressure is normally defined as force per area. However, in the context of gasses in an enclosed space, there is also the concept of thermodynamic pressure. If there are two boxes of gasses divided by a flexible wall that can move back and forth, then volume can be exhanged between these two boxes (while the total volume of both boxes remains the same). The wall will move until the two bexes are in thermodynamic equilibrium, at which point the change entropy per increase in in volume is the same for both boxes and thermodynamic pressure is equal. So thermodynamic pressure is the change in volume per change in entropy.

By modelling gas pressure as tiny particles bouncing against the wall, and doing some experiments, it is possible to find the conversion between thermodynamic pressure and normal pressure.