Globular clusters (GCs) are typically old, with most having formed at z ≳ 2. This makes understanding their birth environments difficult, as they are typically too distant to observe with sufficient angular resolution to resolve GC birth sites. Using 25 cosmological zoom-in simulations of Milky Way-like galaxies from the E-MOSAICS project, with physically motivated models for star formation, feedback, and the formation, evolution, and disruption of GCs, we identify the birth environments of present-day GCs. We find roughly half of GCs in these galaxies formed in situ (52.0 ± 1.0 per cent) between z ≈ 2–4, in turbulent, high-pressure discs fed by gas that was accreted without ever being strongly heated through a virial shock or feedback. A minority of GCs form during mergers (12.6 ± 0.6 per cent in major mergers, and 7.2 ± 0.5 per cent in minor mergers), but we find that mergers are important for preserving the GCs seen today by ejecting them from their natal, high density interstellar medium (ISM), where proto-GCs are rapidly destroyed due to tidal shocks from ISM substructure. This chaotic history of hierarchical galaxy assembly acts to mix the spatial and kinematic distribution of GCs formed through different channels, making it difficult to use observable GC properties to distinguish GCs formed in mergers from ones formed by smooth accretion, and similarly GCs formed in situ from those formed ex situ. These results suggest a simple picture of GC formation, in which GCs are a natural outcome of normal star formation in the typical, gas-rich galaxies that are the progenitors of present-day galaxies.