  We use the TNG300 magneto-hydrodynamic simulation and mock catalogues built
using subhalo abundance matching (SHAM) to study the origin of the redshift
evolution of the halo occupation distribution (HOD). We analyse stellar-mass
selected galaxy samples with fixed number densities, spanning the redshift
range $0 \le z \le 3$. We measure their halo occupation functions and fit the
HOD parameters to study their evolution over cosmic time. The TNG300 galaxy
population strongly depends on the baryonic physics implemented in the
simulation. In contrast, the galaxy population predicted by a basic SHAM model
without scatter is a direct result of the cosmology of the dark matter
simulation. We find that the HOD evolution is similar for both models and is
consistent with a previous study of the HOD evolution in semi-analytical
models. Specifically, this is the case for the ratio between the characteristic
halo masses for hosting central and satellite galaxies. The only HOD parameter
whose evolution varies across models is $\sigma_{\rm logM}$, which contains
information about the stellar mass-halo mass relation of the galaxies and does
not strongly impact galaxy clustering. We also demonstrate that the dependence
on the specific values of the cosmological parameters is small. We conclude
that the cosmology of the galaxy sample, i.e. the cosmological hierarchical
growth of structure, and not the baryonic physics prescriptions, governs the
evolution of the HOD for stellar mass-selected samples. These results have
important implications for populating simulated lightcones with galaxies and
can facilitate the interpretation of clustering data at different redshifts.
