  Galaxies accrete their mass by means of both smooth accretion from the cosmic
web, and the mergers of smaller entities. We wish to quantify the respective
role of these two modes of accretion, which could determine the morphological
types of galaxies observed today. Multi-zoom cosmological simulations are used
to estimate as a function of time the evolution of mass in bound systems, for
dark matter as well as baryons. The baryonic contents of dark matter haloes are
studied. Merger histories are followed as a function of external density, and
the different ways in which mass is assembled in galaxies and the stellar
component accumulated are quantified. We find that most galaxies assemble their
mass through smooth accretion, and only the most massive galaxies also grow
significantly through mergers. The mean fraction of mass assembled by accretion
is 77 %, and by mergers 23 %. We present typical accretion histories of
hundreds of galaxies: masses of the most massive galaxies increase
monotonically in time, mainly through accretion, many intermediate-mass objects
also experience mass-loss events such as tidal stripping and evaporation.
However, our simulations suffer from the overcooling of massive galaxies caused
by the neglect of active galaxy nuclei (AGN) feedback. The time by which half
of the galay mass has assembled, both in dark matter and baryons, is a
decreasing function of mass, which is compatible with the observations of a
so-called downsizing. At every epoch in the universe, there are low-mass
galaxies actively forming stars, while more massive galaxies form their stars
over a shorter period of time within half the age of the universe.
