We use the IllustrisTNG50 cosmological hydrodynamical simulation,
complemented by a catalog of tagged globular clusters, to investigate the
properties and build up of two extended luminous components: the intra-cluster
light (ICL) and the intra-cluster globular clusters (ICGC). We select the 39
most massive groups and clusters in the box, spanning the range of virial
masses 5Γ1012<M200β/Mββ<2Γ1014. We
find good agreement between predictions from the simulations and current
observational estimates of the fraction of mass in the ICL and its radial
extension. The stellar mass of the ICL is only βΌ10%β20% of the stellar
mass in the central galaxy but encodes useful information on the assembly
history of the group or cluster. About half the ICL in all our systems is
brought in by galaxies in a narrow stellar mass range, Mββ=1010β1011Mββ. However, the contribution of low-mass galaxies (Mββ<1010Mββ) to the build-up of the ICL varies broadly from system to
system, βΌ5%β45%, a feature that might be recovered from the observable
properties of the ICL at z=0. At fixed virial mass, systems where the
accretion of dwarf galaxies plays an important role have shallower metallicity
profiles, less metal content and a lower stellar mass in the ICL than systems
where the main contributors are more massive galaxies. We show that
intra-cluster GCs are also good tracers of this history, representing a
valuable alternative when diffuse light is not detectable