Abstract We combine the published stellar mass function (SMF) and gas scaling relations to explore the baryonic (stellar plus cold gas) mass function (BMF) of galaxies to redshift z = 3. We find evidence that at log(M baryon/M ☉) > 11.3, the BMF has evolved little since z ∼ 2.2. With the evolution of BMF and SMF, we investigate the baryon net accretion rate ( ) and stellar mass growth rate ( ) for the galaxy population of log(M star/M ☉) > 10. The ratio between these two quantities, / , decreases from / at z ∼ 2.5 to / at z ∼ 0.5, suggesting that massive galaxies are transforming from the “accretion-dominated” phase to the “depletion-dominated” phase from high-z to low-z. The transition of these two phases occurs at z ∼ 1.5, which is consistent with the onset redshift of the decline of cosmic star formation rate density (CSFD). This provides evidence to support the idea that the decline of CSFD since z ∼ 1.5 mainly results from the decline of baryon net accretion rate and star formation quenching in galaxies.