  We use deep Herschel PACS and SPIRE observations in GOODSS, GOODSN and COSMOS
to estimate the average dust mass (Mdust) of galaxies on a redshift-stellar
mass (Mstar)-SFR grid. We study the scaling relations between Mdust, Mstar and
SFR at z<=2.5. No clear evolution of Mdust is observed at fixed SFR and Mstar.
We find a tight correlation between SFR and Mdust, likely a consequence of the
Schmidt-Kennicutt (S-K) law. The Mstar-Mdust correlation observed by previous
works flattens or sometimes disappears when fixing the SFR. Most of it likely
derives from the combination of the Mdust-SFR and Mstar-SFR correlations. We
then investigate the gas content as inferred by converting Mdust by assuming
that the dust/gas ratio scales linearly with the gas metallicity. All galaxies
in the sample follow, within uncertainties, the same SFR-Mgas relation
(integrated S-K law), which broadly agrees with CO-based results for the bulk
of the population, despite the completely different approaches. The majority of
galaxies at z~2 form stars with an efficiency (SFE=SFR/Mgas) ~5 times higher
than at z~0. It is not clear what fraction of such variation is an intrinsic
redshift evolution and what fraction arises from selection effects. The gas
fraction (fgas) decreases with Mstar and increases with SFR, and does not
evolve with z at fixed Mstar and SFR. We explain these trends by introducing a
universal relation between fgas, Mstar and SFR, non-evolving out to z~2.5.
Galaxies move across this relation as their gas content evolves in time. We use
the 3D fundamental fgas-Mstar-SFR relation and the redshift evolution of the
Main Sequence to estimate the evolution of fgas in the average population of
galaxies as a function of z and Mstar, and we find evidence a downsizing
scenario.
