The location of Galactic Globular Clusters (GC) stars on the horizontal branch (HB) should mainly depend on GC metallicity, the first parameter, but it is actually the result of complex interactions between the red giant branch (RGB) mass loss, the coexistence of multiple stellar populations with different helium content, and the presence of a second parameter which produces dramatic differences in HB morphology of GCs of similar metallicity and ages (like the pair M3-M13). In this work, we combine the entire dataset from the Hubble Space Telescope Treasury survey and stellar evolutionary models, to analyse the HBs of 46 GCs. For the first time in a large sample of GCs, we generate population synthesis models, where the helium abundances for the first and the extreme second generations are constrained using independent measurements based on RGB stars. The main results are 1) the mass loss of first generation stars is tightly correlated to cluster metallicity. 2) the location of helium enriched stars on the HB is reproduced only by adopting a higher RGB mass loss than for the first generation. The difference in mass loss correlates with helium enhancement and cluster mass. 3) A model of pre-main sequence disc early loss, previously developed by the authors, explains such a mass loss increase and is consistent with the findings of multiple-population formation models predicting that populations more enhanced in helium tend to form with higher stellar densities and concentrations. 4) Helium-enhancement and mass-loss both contribute to the second parameter.