  We have used the NIHAO simulations to explore how supernovae (SNe) affect
star formation in galaxies. We find that SN feedback operates on all scales
from the interstellar medium (ISM) to several virial radii. SNe regulate star
formation by preventing condensation of HI into H$_2$ and by moving cold
neutral gas to the hot HII phase. The first effect explains why the cold
neutral gas in dwarf galaxies forms stars inefficiently. The second maintains
the hot ISM of massive galaxies (HII vents out at lower masses). At $v_{\rm
vir}\simeq 67{\rm\,km\,s}^{-1}$, the outflow rate follows the relation:
$\dot{M}_{\rm out}=23\,(v_{\rm vir}/67{\rm\,km\,s}^{-1})^{-4.6}\,{\rm SFR}$.
$20\%$ to $70\%$ of the gas expelled from galaxies escapes from the halo
(ejective feedback) but outflows are dominated by cold swept-up gas, most of
which falls back onto the galaxy on a $\sim 1\,$Gyr timescale. This `fountain
feedback' reduces the masses of galaxies by a factor of two to four, since gas
spends half to three quarter of its time in the fountain. Less than $10\%$ of
the ejected gas mixes with the hot circumgalactic medium and this gas is
usually not reaccreted. On scales as large as $6r_{\rm vir}$, galactic winds
divert the incoming gas from cosmic filaments and prevent if from accreting
onto galaxies (pre-emptive feedback). This process is the main reason for the
low baryon content of ultradwarves.

Astrophysics of Galaxies