The energy and momentum deposited by the radiation from accretion flows onto the supermassive black holes ( BHs ) that reside at the centres of virtually all galaxies can halt or even reverse gas inflow , providing a natural mechanism for supermassive BHs to regulate their growth and to couple their properties to those of their host galaxies . However , it remains unclear whether this self-regulation occurs on the scale at which the BH is gravitationally dominant , on that of the stellar bulge , the galaxy , or that of the entire dark matter halo . To answer this question , we use self-consistent simulations of the co-evolution of the BH and galaxy populations that reproduce the observed correlations between the masses of the BHs and the properties of their host galaxies . We first confirm unambiguously that the BHs regulate their growth : the amount of energy that the BHs inject into their surroundings remains unchanged when the fraction of the accreted rest mass energy that is injected , is varied by four orders of magnitude . The BHs simply adjust their masses so as to inject the same amount of energy . We then use simulations with artificially reduced star formation rates to demonstrate explicitly that BH mass is not set by the stellar mass . Instead , we find that it is determined by the mass of the dark matter halo with a secondary dependence on the halo concentration , of the form that would be expected if the halo binding energy were the fundamental property that controls the mass of the BH . We predict that the black hole mass , m _ { BH } , scales with halo mass as m _ { BH } \propto m _ { halo } ^ { \alpha } , with \alpha \approx 1.55 \pm 0.05 and that the scatter around the mean relation in part reflects the scatter in the halo concentration-mass relation .