  Observations show that star formation in galaxies is closely correlated with
the abundance of molecular hydrogen. Modeling this empirical relation from
first principles proves challenging, however, and many questions regarding its
properties remain open. For instance, the exact functional form of the relation
is still debated and it is also unknown whether it applies at z>4, where CO
observations are sparse. Here, we analyze how the shape of the star formation
-- gas relation affects the cosmic star formation history and global galaxy
properties using an analytic model that follows the average evolution of
galaxies in dark matter halos across cosmic time. We show that a linear
relation with an H2 depletion time of ~2.5 Gyr, as found in studies of nearby
galaxies, results in good agreement with current observations of galaxies at
both low and high redshift. These observations include the evolution of the
cosmic star formation rate density, the z~4-9 UV luminosity function, the
evolution of the mass -- metallicity relation, the relation between stellar and
halo mass, and the gas-to-stellar mass ratios of galaxies. In contrast, the
short depletion times that result from adopting a highly super-linear star
formation -- gas relation lead to large star formation rates, substantial metal
enrichment (~0.1 solar), and low gas-to-stellar mass ratios already at z~10, in
disagreement with observations. These results can be understood in terms of an
equilibrium picture of galaxy evolution in which gas inflows, outflows, and
star formation drive the metallicities and gas fractions toward equilibrium
values that are determined by the ratio of the accretion time to the gas
depletion time. In this picture, the cosmic modulation of the accretion rate is
the primary process that drives the evolution of stellar masses, gas masses,
and metallicities of galaxies from high redshift until today.
