We combine the latest observationally motivated constraints on stellar properties in dark matter haloes , along with data-driven predictions for the atomic ( HI ) and molecular ( H _ { 2 } ) gas evolution in galaxies , to derive empirical relationships between the build-up of galactic components and their evolution over cosmic time . We find that at high redshift ( z \gtrsim 4 ) , galaxies acquire their cold gas ( both atomic and molecular ) mostly by accretion , with the fraction of cold gas reaching about 20 % of the cosmic baryon fraction . We find a strong dependence of the star formation rate on the H _ { 2 } mass , suggesting a near-universal depletion timescale of 0.1-1 Gyr in Milky Way sized haloes ( of masses 10 ^ { 12 } M _ { \odot } at z = 0 ) . We also find evidence for a near-universality of the Kennicutt-Schmidt relation across redshifts , with very little dependence on stellar mass , if a constant conversion factor ( \alpha _ { CO } ) of CO luminosity to molecular gas mass is assumed . Combining the atomic and molecular gas observations with the stellar build-up illustrates that galactic mass assembly in Milky-Way sized haloes proceeds from smooth accretion at high redshifts , towards becoming merger-dominated at late times ( z \lesssim 0.6 ) . Our results can be used to constrain numerical simulations of the dominant growth and accretion processes of galaxies over cosmic history .