We study and classify smooth bounded domains in an analytic Riemannian manifold which are critical for the heat content at all times $$t>0$$
t
>
0
. We do that by first computing the first variation of the heat content, and then showing that $$\Omega $$
Ω
is critical if and only if it has the so-called constant flow property, so that we can use a previous classification result established in [33] and [34]. The outcome is that $$\Omega $$
Ω
is critical for the heat content at time t, for all $$t>0$$
t
>
0
, if and only if $$\Omega $$
Ω
admits an isoparametric foliation, that is, a foliation whose leaves are all parallel to the boundary and have constant mean curvature. Then, we consider the sequence of functionals given by the exit-time moments $$T_1(\Omega ),T_2(\Omega ),\dots $$
T
1
(
Ω
)
,
T
2
(
Ω
)
,
⋯
, which generalize the torsional rigidity $$T_1$$
T
1
. We prove that $$\Omega $$
Ω
is critical for all $$T_k$$
T
k
if and only if $$\Omega $$
Ω
is critical for the heat content at every time t, and then we get a classification as well. The main purpose of the paper is to understand the variational properties of general isoparametric foliations and their role in PDE’s theory; in some respects they generalize the properties of the foliation of $$\mathbf{R}^{n}$$
R
n
by Euclidean spheres.