  Methods. We have modelled a sample of ~800 nearby galaxies, spanning a wide
range of metallicity, gas fraction, specific star formation rate and Hubble
stage. We have derived the dust properties of each object from its spectral
energy distribution. Through an additional level of analysis, we have inferred
the timescales of dust condensation in core-collapse supernova ejecta, grain
growth in cold clouds and dust destruction by shock waves. Throughout this
paper, we have adopted a hierarchical Bayesian approach, resulting in a single
large probability distribution of all the parameters of all the galaxies, to
ensure the most rigorous interpretation of our data. Results. We confirm the
drastic evolution with metallicity of the dust-to-metal mass ratio (by two
orders of magnitude), found by previous studies. We show that dust production
by core-collapse supernovae is efficient only at very low-metallicity, a single
supernova producing on average less than ~0.03 Msun/SN of dust. Our data
indicate that grain growth is the dominant formation mechanism at metallicity
above ~1/5 solar, with a grain growth timescale shorter than ~50 Myr at solar
metallicity. Shock destruction is relatively efficient, a single supernova
clearing dust on average in at least ~1200 Msun/SN of gas. These results are
robust when assuming different stellar initial mass functions. In addition, we
show that early-type galaxies are outliers in several scaling relations. This
feature could result from grain thermal sputtering in hot X-ray emitting gas,
an hypothesis supported by a negative correlation between the dust-to-stellar
mass ratio and the X-ray photon rate per grain. Finally, we confirm the
well-known evolution of the aromatic-feature-emitting grain mass fraction as a
function of metallicity and interstellar radiation field intensity. Our data
indicate the relation with metallicity is significantly stronger.
