Context. Studies of the generation and assembly of stellar populations in galaxies largely benefit from far-IR observations, considering that the IR flux is a close prior to the rate of star formation (the bulk of which happens in dust-obscured environments). At the same time, major episodes of nuclear AGN accretion are also dust-obscured and visible in the IR. Aims. At the end of the Spitzer cryogenic mission and the onset of the Herschel era, we review our current knowledge of galaxy evolution at IR wavelengths, and model it to achieve as far as a complete view of the evolution of cosmic sources. We also develop new tools for the analysis of background fluctuations to constrain source counts in regimes of high confusion, as it happens for the Herschel sub-mm surveys. Methods. We analysed a wide variety of new data on galaxy evolution and high-redshift source populations from Spitzer cosmological surveys, and confront them with complementary data from mm ground-based observations and constraints from the far-IR diffuse radiation, as well as preliminary results from Herschel surveys. Results. These data confirm earlier indications about a very rapid increase in galaxy volume emissivity with redshift up to z 1 [ρ(z) ∝ (1 + z) 4 ], the fastest evolution rate observed for galaxies at any wavelengths. The observed Spitzer counts require a combination of fast evolution for the dominant population and a bumpy spectrum with substantial PAH emission at z ∼ 1 to 2. Number counts at long wavelengths (70 through 1100 μm) confirm these results. All the present data require that the fast observed evolution from z = 0 to 1 flattens around redshift 1 and then keeps approximately constant up to z 2.5 at least. Our estimated redshift-dependent bolometric comoving energy density keeps lower at z > ∼ 1.5 than some previously published results based on either large extinction corrections, or large spectral extrapolations.Conclusions. The present-day IR/sub-mm data provide evidence of a distinct population of very luminous galaxies becoming dominant at z > 1. Their cosmological evolution, peaking around z 2, shows a faster decay with cosmic time than lower luminosity systems, whose maximal activity is set around z 1, then supporting an earlier phase of formation for the most luminous and massive galaxies. From a comparison of our results on the comoving IR emissivity with recent estimates of the redshift-dependent stellar mass functions of galaxies, we find that the two agree well with each other if we assume standard recipes for star formation (a universal Salpeter IMF) and standard fractions (∼20−30%) for the contribution of obscured AGN accretion. Systematic exploitation of the forthcoming Herschel survey data will be important for confirming all this.