  In the hierarchical scenario of structure formation, galaxy clusters are the
ultimate virialised products in mass and time. Hot baryons in the intracluster
medium (ICM) and cold baryons in galaxies inhabit a dark matter dominated halo.
Internal processes, accretion, and mergers can perturb the equilibrium, which
is established only at later times. However, the cosmic time when
thermalisation is effective is still to be assessed. Here we show that massive
clusters in the observed universe attained an advanced thermal equilibrium
$\sim~1.8~\text{Gyr}$ ago, at redshift $z =0.14\pm0.06$, when the universe was
$11.7\pm0.7~\text{Gyr}$ old. Hot gas is mostly thermalised after the time when
cosmic densities of matter and dark energy match. We find in a statistically
nearly complete and homogeneous sample of 120 clusters from the {\it Planck}
Early Sunyaev-Zel'dovich (ESZ) sample that the kinetic energy traced by the
galaxy velocity dispersion is a faithful probe of the gravitational energy
since a look back time of at least $\sim5.4~\text{Gyr}$, whereas the efficiency
of hot gas in converting kinetic to thermal energy, as measured through X-ray
observations in the core-excised area within $r_{500}$, steadily increases with
time. The evolution is detected at the $\sim 98$ per cent probability level.
Our results demonstrate that halo mass accretion history plays a larger role
for cluster thermal equilibrium than radiative physics. The evolution of hot
gas is strictly connected to the cosmic structure formation.
