  We use ~100 cosmological galaxy formation zoom-in simulations using the
smoothed particle hydrodynamics code {\sc gasoline} to study the effect of
baryonic processes on the mass profiles of cold dark matter haloes. The haloes
in our study range from dwarf (M_{200}~10^{10}Msun) to Milky Way
(M_{200}~10^{12}Msun) masses. Our simulations exhibit a wide range of halo
responses, primarily varying with mass, from expansion to contraction, with up
to factor ~10 changes in the enclosed dark matter mass at one per cent of the
virial radius. Confirming previous studies, the halo response is correlated
with the integrated efficiency of star formation:
e_SF=(M_{star}/M_{200})/(\Omega_b/\Omega_m). In addition we report a new
correlation with the compactness of the stellar system: e_R=r_{1/2}/R_{200}. We
provide an analytic formula depending on e_SF and e_R for the response of cold
dark matter haloes to baryonic processes. An observationally testable
prediction is that, at fixed mass, larger galaxies experience more halo
expansion, while the smaller galaxies more halo contraction. This diversity of
dark halo response is captured by a toy model consisting of cycles of adiabatic
inflow (causing contraction) and impulsive gas outflow (causing expansion). For
net outflow, or equal inflow and outflow fractions, f, the overall effect is
expansion, with more expansion with larger f. For net inflow, contraction
occurs for small f (large radii), while expansion occurs for large f (small
radii), recovering the phenomenology seen in our simulations. These
regularities in the galaxy formation process provide a step towards a fully
predictive model for the structure of cold dark matter haloes.
