  We present high-precision lattice calculations of the thermodynamics of
Yang-Mills theories with different gauge groups. In the confining phase, we
show that the equation of state is described remarkably well by a gas of
massive, non-interacting glueballs, provided that an effective bosonic
closed-string model is used to derive an exponentially growing Hagedorn
spectrum for the heavy states. In particular, this model describes very
accurately the results for the SU(3) theory reported by Bors\'anyi et al. in
JHEP 07 (2012) 056, as well as a novel set of lattice data for the SU(2)
theory. In addition, we also also show that the equation of state in the
deconfined phase exhibits a near perfect proportionality to the number of gluon
degrees of freedom, including for the Yang-Mills theory based on the
exceptional, center-less gauge group $G_2$.
