  The eROSITA will deliver an unprecedented volume of X-ray survey
observations, 20-30 times more sensitive than ROSAT in the soft band (0.5-2
keV) and for the first time imaging in the hard band (2-10 keV) including
galaxy clusters and groups along with obscured and unobscured AGNs. This calls
for a powerful theoretical effort to control the systematics and biases that
may affect the data analysis. We investigate the detection technique and
selection effects in the galaxy group and AGN populations of a mock eROSITA
survey at the depth of eRASS:4. We create a $30\times 30$ deg$^{2}$ mock
observation based on the cosmological hydrodynamical simulation Magneticum
Pathfinder within z=0-0.2. We combine a physical background extracted from the
real eFEDS background analysis with realistic simulations of X-ray emission for
the hot gas, AGNs and X-ray binaries. We apply a detection procedure equivalent
to the reduction done on eRASS data and evaluate the completeness and
contamination to reconstruct the luminosity functions of the extended and point
sources in the catalogue. We assess the completeness of extended detections as
a function of the input X-ray flux and halo. We achieve full recovery of the
brightest (most massive) clusters and AGNs. However, a significant fraction of
galaxy groups remains undetected. Examining the gas properties between the
detected and undetected galaxy groups at fixed halo mass, we observe that the
detected population exhibits, on average, higher X-ray brightness compared to
the undetected ones. Moreover, we find that X-ray luminosity primarily
correlates with the hot gas fraction, rather than temperature or metallicity.
Our simulation suggests the presence of a systematic selection effect in
current surveys, resulting in X-ray survey catalogues predominantly composed of
the lowest-entropy, gas-richest, and highest surface brightness halos on galaxy
group scales.
