  Galaxies fall into two clearly distinct types: `blue-sequence' galaxies that
are rapidly forming young stars, and `red-sequence' galaxies in which star
formation has almost completely ceased. Most galaxies more massive than
$3\times10^{10} M_\odot$ follow the red-sequence while less massive central
galaxies lie on the blue sequence. We show that these sequences are created by
a competition between star formation-driven outflows and gas accretion on to
the supermassive black hole at the galaxy's center. We develop a simple
analytic model for this interaction. In galaxies less massive than
$3\times10^{10} M_\odot$, young stars and supernovae drive a high entropy
outflow that is more buoyant that any diffuse corona. The outflow balances the
rate of gas inflow, preventing high gas densities building up in the central
regions. More massive galaxies, however, are surrounded by a hot corona. We
argue that above a halo mass of $\sim 10^{12} M_\odot$, the supernova-driven
outflow is no longer buoyant and star formation is unable to prevent the build
up of gas in the central regions. This triggers a strongly non-linear response
from the black hole. Its accretion rate rises rapidly, heating the galaxy's
corona, disrupting the incoming supply of cool gas and starving the galaxy of
the fuel for star formation. The host galaxy makes a transition to the red
sequence, and further growth predominantly occurs through galaxy mergers. We
show that the analytic model provides a good description of galaxy evolution in
the EAGLE hydrodynamic simulations, and demonstrate that, so long as star
formation-driven outflows are present, the transition mass scale is almost
independent of subgrid parameter choice. The transition mass disappears
entirely, however, if star formation driven outflows are absent.
