We have studied the mass assembly and star formation histories of massive galaxies identified at low redshift in different cosmological hydrodynamical simulations. To this end, we have carried out a detailed follow-up backwards in time of their constituent mass elements (sampled by particles) of different types. After that, the configurations they depict at progressively higher zs were carefully analysed. The analyses show that these histories share common generic patterns, irrespective of particular circumstances. In any case, however, the results we have found are different depending on the particle type. The most outstanding differences follow. We have found that by z ∼ 3.5-6, mass elements identified as stellar particles at z = 0 exhibit a gaseous cosmic-web-like morphology with scales of ∼1 physical Mpc, where the densest mass elements have already turned into stars by z ∼ 6. These settings are in fact the densest pieces of the cosmic web, where no hot particles show up, and dynamically organized as a hierarchy of flow convergence regions (FCRs), that is, attraction basins for mass flows. At high z FCRs undergo fast contractive deformations with very low angular momentum, shrinking them violently. Indeed, by z ∼ 1 most of the gaseous or stellar mass they contain shows up as bound to a massive elliptical-like object at their centres, with typical half-mass radii of r mass star ∼ 2-3 kpc. After this, a second phase comes about where the mass assembly rate is much slower and characterized by mergers involving angular momentum. On the other hand, mass elements identified at the diffuse hot coronae surrounding massive galaxies at z = 0 do not display a clear web-like morphology at any z. Diffuse gas is heated when FCRs go through contractive deformations. Most of this gas remains hot and with low density throughout the evolution. To shed light on the physical foundations of the behaviour revealed by our analyses (i.e. a two-phase formation process with different implications for diffuse or shocked mass elements), as well as on their possible observational implications, these patterns have been confronted with some generic properties of singular flows as described by the adhesion model (i.e. potential character of the velocity field, singular versus regular points, dressing, locality when a spectrum of perturbations is implemented). We have found that the common patterns the simulations show can be interpreted as a natural consequence of flow properties that, moreover, could explain different generic observational results from massive galaxies or their samples. We briefly discuss some of them.