  The characterization of the dynamical state of clusters is key to study their
evolution, their selection, and use them as a cosmological probe. The offsets
between different definitions of the center have been used to estimate the
cluster disturbance. Our goal is to study the distribution of the offset
between the X-ray and optical centers in clusters of galaxies. We study the
offset for eROSITA clusters. We aim to connect observations to hydrodynamical
simulations and N-body models. We assess the astrophysical effects affecting
the displacements. We measure the offset for clusters observed in eFEDS and
eRASS1. We focus on a subsample of 87 massive eFEDS clusters at low redshift.
We link the observations to the offset parameter Xoff measured on dark matter
halos in N-body simulations, using the hydrodynamical simulations as a bridge.
eFEDS clusters show a smaller offset compared to eRASS1, because the latter
contains a larger fraction of massive and disturbed structures. We measure an
average offset of 76.3+30.1-27.1 kpc on the subsample of 87 eFEDS clusters.
This is in agreement with the predictions from TNG and Magneticum, and the
distribution of Xoff from DMO simulations. The tails of the distributions are
different. Using the offset to classify relaxed and disturbed clusters, we
measure a relaxed fraction of 31% in the eFEDS subsample. Finally, we find a
correlation between the offset in hydrodynamical simulations and Xoff measured
on their parent DMO run and calibrate a relation between them. There is good
agreement between eROSITA data and simulations. Baryons cause a decrement
(increment) in the low (high) offset regime compared to the Xoff distribution.
The offset-Xoff relation provides an accurate prediction of the true Xoff
distribution in Magneticum and TNG. It allows introducing the offsets in
cosmology, marginalizing on dynamical selection effects.
