The resource theory of thermal operations, an established model for small-scale thermodynamics, provides an extension of equilibrium thermodynamics to nonequilibrium situations. On a lattice of any dimension with any translation-invariant local Hamiltonian, we identify a large set of translation-invariant states that can be reversibly converted to and from the thermal state with thermal operations and a small amount of coherence. These are the spatially ergodic states, i.e., states that have sharp statistics for any translation-invariant observable, and mixtures of such states with the same thermodynamic potential. As an intermediate result, we show for a general state that if the gap between the min- and the max-relative entropies to the thermal state is small, then the state can be approximately reversibly converted to and from the thermal state with thermal operations and a small source of coherence. Our proof provides a quantum version of the Shannon-McMillan-Breiman theorem for the relative entropy and a quantum Stein’s lemma for ergodic states and local Gibbs states. Our results provide a strong link between the abstract resource theory of thermodynamics and more realistic physical systems as we achieve a robust and operational characterization of the emergence of a thermodynamic potential in translation-invariant lattice systems.