the cold dark matter model. Density fluctuations grow by gravitational instability and form dark matter haloes, which evolve via accretion and mergers with other haloes [@Press:1974]. [@WhiteRees:1978] formulated the basis of modern galaxy formation theory starting from this concept, postulating that galaxies form inside dark matter haloes via the cooling of gas, star formation and mergers of galaxies. This framework is the basis of semi-analytic models of galaxy formation (SAMs; see, e.g., @Baugh:2006 [@Benson:2010] for reviews). These models use the merger histories of dark matter haloes as the starting point to model galaxy formation. The first SAMs used merger trees constructed using Monte-Carlo approaches based on the extended Press-Schechter theory (e.g., @Lacey:1993 [@Cole:1994; @Kauffmann:1993]), while modern SAMs use merger trees extracted from high-resolution dark matter simulations (e.g., @Kauffmann:1999 [@Bower:2006; @DeLucia:2007; @Lagos:2008; @Benson:2012; @Jiang:2014; @Croton:2016; @Lagos:2018; @Stevens:2018]). This opens up the prospect of studying environmental influences on the formation histories and properties of dark matter haloes and the impact on the galaxies they host.

The framework that led to SAMs also underpins the development of the halo occupation distribution (HOD) approach as an empirical description of galaxy clustering (e.g., @Peacock:2000 [@Berlind:2002; @Cooray:2002; @Zheng:2005]). The HOD formalism characterizes the relationship between galaxies 