We introduce a simple analytic model of galaxy formation that links the growth of dark matter haloes in a cosmological background to the build-up of stellar mass within them. The model aims to identify the physical processes that drive the galaxy-halo co-evolution through cosmic time. The model restricts the role of baryonic astrophysics to setting the relation between galaxies and their haloes. Using this approach, galaxy properties can be directly predicted from the growth of their host dark matter haloes. We explore models in which the effective star formation efficiency within haloes is a function of mass (or virial temperature) and independent of time. Despite its simplicity, the model reproduces self-consistently the shape and evolution of the cosmic star formation rate density, the specific star formation rate of galaxies, and the galaxy stellar mass function, both at the present time and at high redshifts. By systematically varying the effective star formation efficiency in the model, we explore the emergence of the characteristic shape of the galaxy stellar mass function. The origin of the observed double Schechter function at low redshifts is naturally explained by two efficiency regimes in the stellar to halo mass relation, namely, a stellar feedback regulated stage, and a supermassive black hole regulated stage. By providing a set of analytic differential equations, the model can be easily extended and inverted, allowing the roles and impact of astrophysics and cosmology to be explored and understood.