When looking at a macroscopic system (a pendulum for instance) we usually describe it in terms of terms of their general coordinates and assume Energy is conserved. We know this is an idealisation as real macroscopic systems are dissipative, they lose Energy in the form of heat due to friction. In fact this heat generation is nothing more than a transfer of the mechanical energy associated with the macroscopic degrees of freedom (E_kin of the Centre of Mass) to the mechanical energy associated with the microscopic degrees of freedom (movement of individual molecules). Now due to this unavoidable "energy loss" macroscopic objects tend to favor the state with the lowest potential energy, something known as a stable state. Now it is very clear to me based on this logic why macroscopic systems tend to move towards equilibrium but it is unclear to me why this is also true for microscopic system like say an atom. Let me elaborate, if we have a hydrogen atom in an excited state (thus not the lowest potential) it will fall back to it's ground state after a certain time by emitting a photon. Thus in analogy with the macroscopic system it loses energy, this time in the form of a photon instead of in the form of heat. Now what principle is responsible for the fact that systems favor the lowest potential and where does it derive from? Or am I plainly wrong and do microscopic systems not favor the lowest potential at all.