  We study the distributions of the baryons in massive halos ($M_{vir} >
10^{13} \ h^{-1}M_{\odot}$) in the $Magneticum$ suite of Smoothed Particle
Hydrodynamical cosmological simulations, out to the unprecedented radial extent
of $10 R_{500,\mathrm c}$. We confirm that, under the action of
non-gravitational physical phenomena, the baryon mass fraction is lower in the
inner regions ($<R_{500,\mathrm c}$) of increasingly less massive halos, and
rises moving outwards, with values that spans from 51% (87%) in the regions
around $R_{500,\mathrm c}$ to 95% (100%) at $10R_{500,\mathrm c}$ of the
cosmological value in the systems with the lowest (highest; $M_{vir} \sim 5
\times 10^{14} \ h^{-1}M_{\odot}$) masses. The galaxy groups almost match the
gas (and baryon) fraction measured in the most massive halos only at very large
radii ($r>6 R_{500,\mathrm c}$), where the baryon depletion factor $Y_{\rm bar}
= f_{\rm bar} / (\Omega_{\rm b}/\Omega_{\rm m})$ approaches the value of unity,
expected for "closed-box" systems. We find that both the radial and mass
dependency of the baryon, gas, and hot depletion factors are predictable and
follow a simple functional form. The star mass fraction is higher in less
massive systems, decreases systematically with increasing radii, and reaches a
constant value of $Y_{\rm star} \approx 0.09$, where also the gas metallicity
is constant, regardless of the host halo mass, as a result of the early ($z>2$)
enrichment process.
