We present a detailed chemical tagging of individual stellar populations in the Galactic globular cluster (GC) NGC 1851. Abundances are derived from FLAMES spectra for the largest sample of giants (124) and the most extensive number of elements ever analysed in this peculiar GC. The chemistry is characterised using homogeneous abundances of proton-capture (O, Na, Mg, Al, Si), α-capture (Ca, Ti), Fe-peak (Sc, V, Mn, Co, Ni, Cu), and neutron-capture elements (Y, Zr, Ba, La, Ce, Nd, Eu, Dy). We confirm the presence of an [Fe/H] spread larger than the observational errors in this cluster, but too small to clearly separate different sub-populations. We instead propose a classification scheme using a combination of Fe and Ba (which is much more abundant in the more metal-rich group) by means of a cluster analysis. With this approach, we separated stars into two components of a metal-rich (MR) and a metal-poor (MP) population. Each component displays a Na-O anticorrelation, which is a signature of a genuine GC, but has different ratios of primordial (FG) to polluted (SG) stars. Moreover, clear (anti)correlations of Mg and Si with Na and O are found for each component. The level of [α/H] tracks iron and is higher in the MR population, which might therefore have received an additional contribution from core-collapse supernovae. When considering all s-process elements, the MR population shows a larger enrichment than the MP one. This is probably due to the contribution of intermediate-low mass stars, because we find that the level of heavy s-process elements is higher than that of light s-process nuclei in the MR stars; however, a large contribution from low mass stars is unlikely, because it would likely cancel the O-Na anticorrelation. Finally, we confirm the presence of correlations between the amount of proton-capture elements and the level of s-process elements previously found by other investigations, at least for the MR population. This finding apparently requires a quite long delay for the second generation of the MR component. Scenarios for the formation of NGC 1851 appear complex, and are not yet well understood. A merger of two distinct GCs in a parent dwarf galaxy, each cluster with a different Ba level and an age difference of ∼1 Gyr, might explain (i) the double subgiant branch; (ii) a possible difference in C content between the two original GCs; and (iii) the Strömgren photometry of this peculiar cluster. However, the correlation existing between p-capture and n-capture elements within the MR population requires the additional assumption of a long delay for its second generation. More observations are required to fully understand the formation of this GC.