  We investigate the physics that drives the gas accretion rates onto galaxies
at the centers of dark matter haloes using the EAGLE suite of hydrodynamical
cosmological simulations. We find that at redshifts $z{\le}2$ the accretion
rate onto the galaxy increases with halo mass in the halo mass range
$10^{10}-10^{11.7}M_{\odot}$, flattens between the halo masses
$10^{11.7}-10^{12.7}M_{\odot}$, and increases again for higher-mass haloes.
However, the galaxy gas accretion does not flatten at intermediate halo masses
when AGN feedback is switched off. To better understand these trends, we
develop a physically motivated semi-analytic model of galaxy gas accretion. We
show that the flattening is produced by the rate of gas cooling from the hot
halo. The ratio of the cooling radius and the virial radius does not decrease
continuously with increasing halo mass as generally thought. While it decreases
up to ${\sim}10^{13}M_{\odot}$ haloes, it increases for higher halo masses,
causing an upturn in the galaxy gas accretion rate. This may indicate that in
high-mass haloes AGN feedback is not sufficiently efficient. When there is no
AGN feedback, the density of the hot halo is higher, the ratio of the cooling
and virial radii does not decrease as much and the cooling rate is higher.
Changes in the efficiency of stellar feedback can also increase or decrease the
accretion rates onto galaxies. The trends can plausibly be explained by the
re-accretion of gas ejected by progenitor galaxies and by the suppression of
black hole growth, and hence AGN feedback, by stellar feedback.
