  We present an end-to-end, two-phase model for the origin of globular clusters
(GCs). In the model, populations of stellar clusters form in the high-pressure
discs of high-redshift ($z>2$) galaxies (a rapid-disruption phase due to tidal
perturbations from the dense interstellar medium), after which the galaxy
mergers associated with hierarchical galaxy formation redistribute the
surviving, massive clusters into the galaxy haloes, where they remain until the
present day (a slow-disruption phase due to tidal evaporation). The high galaxy
merger rates of $z>2$ galaxies allow these clusters to be `liberated' into the
galaxy haloes before they are disrupted within the high-density discs. This
physically-motivated toy model is the first to include the rapid-disruption
phase, which is shown to be essential for simultaneously reproducing the wide
variety of properties of observed GC systems, such as their universal
characteristic mass-scale, the dependence of the specific frequency on
metallicity and galaxy mass, the GC system mass-halo mass relation, the
constant number of GCs per unit supermassive black hole mass, and the colour
bimodality of GC systems. The model predicts that most of these observables
were already in place at $z=1$-$2$, although under rare circumstances GCs may
still form in present-day galaxies. In addition, the model provides important
constraints on models for multiple stellar populations in GCs by putting limits
on initial GC masses and the amount of pristine gas accretion. The paper is
concluded with a discussion of these and several other predictions and
implications, as well as the main open questions in the field.
