  The dark matter content of a gravitationally bound halo is known to be
affected by the galaxy and gas it hosts. We characterise this response for
haloes spanning over four orders of magnitude in mass in the hydrodynamical
simulation suites IllustrisTNG and EAGLE. We present simple fitting functions
in the spherically averaged quasi-adiabatic relaxation framework that
accurately capture the dark matter response over the full range of halo mass
and halo-centric distance we explore. We show that commonly employed schemes,
which consider the relative change in radius $r_f/r_i-1$ of a spherical dark
matter shell to be a function of only the relative change in its mass
$M_i/M_f-1$, do not accurately describe the measured response of most haloes in
IllustrisTNG and EAGLE. Rather, $r_f/r_i$ additionally explicitly depends upon
halo-centric distance $r_f/R_{\rm vir}$ for haloes with virial radius $R_{\rm
vir}$, being very similar between IllustrisTNG and EAGLE and across halo mass.
We also account for a previously unmodelled effect, likely driven by
feedback-related outflows, in which shells having $r_f/r_i\simeq1$ (i.e., no
relaxation) have $M_i/M_f$ significantly different from unity. Our results are
immediately applicable to a number of semi-analytical tools for modelling
galactic and large-scale structure. We also study the dependence of this
response on several halo and galaxy properties beyond total mass, finding that
it is primarily related to halo concentration and star formation rate. We
discuss possible extensions of these results to build a deeper physical
understanding of the small-scale connection between dark matter and baryons.
