We revise the scenario of the formation of Galactic globular clusters (GCs) by adding the observed detailed chemical composition of their different stellar generations to the set of their global parameters. We exploit the unprecedented set of homogeneous abundances of more than 1200 red giants in 19 clusters, as well as additional data from literature, to give a new definition of bona fide GCs, as the stellar aggregates showing the Na-O anticorrelation. We propose a classification of GCs according to their kinematics and location in the Galaxy in three populations: disk/bulge, inner halo, and outer halo. We find that the luminosity function of GCs is fairly independent of their population, suggesting that it is imprinted by the formation mechanism only marginally affected by the ensuing evolution. We show that a large fraction of the primordial population should have been lost by the proto-GCs. The extremely low Al abundances found for the primordial population of massive GCs indicate a very fast enrichment process before the formation of the primordial population. We suggest a scenario for the formation of GCs that includes at least three main phases: i) the formation of a precursor population (likely due to the interaction of cosmological structures similar to those that led to the formation of dwarf spheroidals, but residing at smaller Galactocentric distances, with the early Galaxy or with other structures); ii) the triggering of a long episode of star formation (the primordial population) from the precursor population; and iii) the formation of the current GC, mainly within a cooling flow formed by the slow winds of a fraction of the primordial population. The precursor population is very effective in raising the metal content in massive and/or metal-poor (mainly halo) clusters, while its rôle is minor in small and/or metal-rich (mainly disk) ones. Finally, we use principal component analysis and multivariate relations to study the phase of metal enrichment from first to second generation. We conclude that most of the chemical signatures of GCs may be ascribed to a few parameters, the most important being metallicity, mass, and cluster age. Location within the Galaxy (as described by the kinematics) also plays some rôle, while additional parameters are required to describe their dynamical status.