Observational and theoretical progress has established that active
galactic nuclei (AGN) play a decisive role in the formation and
evolution of individual galaxies as well as galaxy groups and clusters.
In particular, there is compelling evidence that AGN vigorously interact
with their surroundings in the central regions of clusters, indicating
that any realistic model of cluster formation needs to account for these
processes. This is also suggested by the failure of previous generations
of hydrodynamical simulations without AGN feedback to simultaneously
account for the paucity of strong cooling flows in clusters, the slope
and amplitude of the observed cluster scaling relations, and the
high-luminosity cut-off of central cluster galaxies. Here we use
high-resolution cosmological simulations of a large cluster and group
sample to study how AGN affect their host systems. We find that AGN
feedback brings the halo gas fraction and the X-ray
luminosity-temperature scaling relation, both of which are notoriously
difficult to reproduce in self-consistent hydrodynamical simulations,
into excellent agreement with observations. At the same time, the
luminosities of central cluster galaxies and the ages of their stellar
populations become much more realistic. Furthermore, our sample of
clusters and groups is of high enough resolution to accurately resolve
galaxy populations down to the smallest galaxies that significantly
contribute to the stellar mass budget. It is therefore also perfectly
suited to study the stripping of stars form cluster galaxies and the
build-up of the intracluster light (ICL). We describe and test four
different methods to identify the ICL in cluster simulations, thereby
allowing us to assess the reliability of the measurements. For all of
the methods, we consistently find a very significant ICL stellar fraction
which exceeds the values typically inferred from observations. However,
we show that this result is robust with respect to numerical resolution
and integration accuracy, remarkably insensitive to changes in the star
formation model, and almost independent of halo mass. We find that
intracluster stars are preferentially stripped in a cluster’s densest
region from massive galaxies that fall into the forming cluster at z >
1. Surprisingly, some of the intracluster stars also form in the
intracluster medium inside cold gas clouds that are stripped out of
infalling galaxies.