  (Abridged) We develop a model for the cosmological role of mergers in the
evolution of starbursts, quasars, and spheroidal galaxies. Combining halo mass
functions (MFs) with empirical halo occupation models, we calculate where major
galaxy-galaxy mergers occur and what kinds of galaxies merge, at all redshifts.
We compare with observed merger MFs, clustering, fractions, and small-scale
environments, and show that this yields robust estimates in good agreement with
observations. Making the simple ansatz that major, gas-rich mergers cause
quasar activity, we demonstrate that this naturally reproduces the observed
rise and fall of the quasar luminosity density from z=0-6, as well as quasar
LFs, fractions, host galaxy colors, and clustering as a function of redshift
and luminosity. The observed excess of quasar clustering on small scales is a
natural prediction of the model, as mergers preferentially occur in regions
with excess small-scale galaxy overdensities. We show that quasar environments
at all observed redshifts correspond closely to the empirically determined
small group scale, where mergers of gas-rich galaxies are most efficient. We
contrast with a secular model in which quasar activity is driven by bars/disk
instabilities, and show that while these modes probably dominate at Seyfert
luminosities, the constraints from clustering (large and small-scale),
pseudobulge populations, disk MFs, luminosity density evolution, and host
galaxy colors argue that they must be a small contributor to the z>1 quasar
luminosity density.
