  We explore the mass content of galaxies residing in galaxy clusters at z=0 in
the EAGLE hydrodynamical simulation as well as the galaxies' mass build-up
through cosmic time. We use a galaxy catalogue generated with the HBT+
algorithm, which identifies subhaloes consistently over time by tracking their
dynamical evolution throughout the simulation. The satellite subhalo-to-stellar
mass relation (SHSMR) is well described by a double power-law. At stellar
masses $9<\log m_\star/\mathrm{M}_\odot<10$, satellites have 20-25% the subhalo
mass of central galaxies at fixed stellar mass. At high stellar masses the
satellite SHSMR is consistent with that of centrals. The satellite SHSMR
decreases steeply for satellites closer to the cluster centre, even in
projection, broadly consistent with recent weak lensing measurements. The
scatter in the satellite SHSMR is larger than that of central galaxies at all
cluster masses and cluster-centric distances $R<R_\mathrm{200m}$. The SHSMR
scatter decreases with stellar mass by about 12% over an order of magnitude,
but this dependence can be explained by the mixing of infall times. There is
significant dark matter preprocessing; the most recent infallers into massive
clusters had already lost up to 50% of their dark matter by the time of infall,
particularly if they fell in indirectly as satellites of another host. On the
contrary, on average satellite galaxies are still gaining stellar mass at the
time of infall and they do so for another 2 Gyr afterwards, although we see
evidence of a slowing growth for indirect infallers. Overall, pre- and
post-processing each have similar impacts on the satellite SHSMR. Finally, we
provide a simple prescription to infer the mean mass loss experienced by
satellites as a function of cluster-centric distance based on a comparison to
central galaxies, convenient for observational weak lensing measurements.
[abridged]
