  We use the IllustrisTNG simulations to show how the fractions of quenched
galaxies vary across different environments and cosmic time, and to quantify
the role AGN feedback and preprocessing play in quenching group and cluster
satellites. At $z=0$, we select galaxies with $M_* = 10^{9-12} M_{\odot}$
residing within ($\leq R_{200c}$) groups and clusters of total host mass
$M_{200c}=10^{13-15.2} M_{\odot}$. TNG predicts a quenched fraction of
$\sim70-90\%$ (on average) for centrals and satellites $\gtrsim 10^{10.5}
M_{\odot}$, regardless of host mass, cosmic time ($0\leq z\leq0.5$),
clustercentric distance and time since infall in the $z=0$ host. Low-mass
centrals ($\lesssim 10^{10} M_{\odot}$), instead, are rarely quenched unless
they become members of groups ($10^{13-14} M_{\odot}$) or clusters
($\geq10^{14} M_{\odot}$), where the quenched fraction rises to $\sim80\%$. The
fraction of low-mass passive galaxies is higher closer to the host center and
for more massive hosts. The population of low-mass satellites accreted
$\gtrsim$4-6 Gyr ago in massive hosts is almost entirely passive, thus
suggesting an upper limit for the time needed for environmental quenching to
occur. In fact, $\sim30\%$ of group and cluster satellites that are quenched at
$z=0$ were already quenched before falling into their current host, and the
bulk of them quenched as early as 4 to 10 billion years ago. For low-mass
galaxies ($\lesssim10^{10-10.5}M_{\odot}$), this is due to preprocessing,
whereby current satellites may have been members of other hosts, and hence have
undergone environmental processes, before falling into their final host, this
mechanism being more common and more effective for the purposes of quenching
for satellites found today in more massive hosts. On the other hand, massive
galaxies quench on their own and because of AGN feedback, regardless of whether
they are centrals or satellites.
