  We use zoom simulations to show how merger-driven disruption of the gas disc
in a galaxy provides its central active galactic nucleus (AGN) with fuel to
drive outflows that entrain and expel a significant fraction of the
circumgalactic medium (CGM). This in turn suppresses replenishment of the
interstellar medium, causing the galaxy to quench up to several Gyr after the
merger. We start by performing a zoom simulation of a present-day star-forming
disc galaxy with the EAGLE galaxy formation model. Then, we re-simulate the
galaxy with controlled changes to its initial conditions, using the genetic
modification technique. These modifications either increase or decrease the
stellar mass ratio of the galaxy's last significant merger, which occurs at
$z\approx 0.74$. The halo reaches the same present-day mass in all cases, but
changing the mass ratio of the merger yields markedly different galaxy and CGM
properties. We find that a merger can unlock rapid growth of the central
supermassive black hole if it disrupts the co-rotational motion of gas in the
black hole's vicinity. Conversely, if a less disruptive merger occurs and gas
close to the black hole is not disturbed, the AGN does not strongly affect the
CGM, and consequently the galaxy continues to form stars. Our result
illustrates how a unified view of AGN feedback, the baryon cycle and the
interstellar medium is required to understand how mergers and quenching are
connected over long timescales.
