The so-called "fundamental metallicity relation" (FMR) has been known for almost 10 years, and it states that galaxies of the same stellar mass but larger star formation rate have more chemically primitive gas. It is thought to be fundamental because it naturally arises from the stochastic feeding of star-formation from external metal-poor gas accretion, a process extremely elusive to observe but essential according the cosmological simulations of galaxy formation. Galaxies transform gas into stars at a rate that quickly exhaust their gas reservoir. Therefore, a continuous supply of external gas is mandatory to keep galaxies forming stars. According to theory, this supply is provided the gas formed during the Big Bang that exists in between galaxies. Thus, the fact that galaxies follow a FMR provides one of best evidence for cosmological gas accretion. Our work shows how the FMR results from the spatial average of the variations in chemical composition existing in the galaxies. The galaxies globally presenting a primitive chemical composition are those having more chemically primitive star-forming regions. If these regions could be removed, all galaxies would look alike. This finding has a number of implications: (1) it supports the current theoretical framework for galaxy formation, (2) it strengthens the existence of both the FMR and the chemical inhomogeneities in galaxies, (3) it indicates that mixing is inefficient in galaxies, and (4) it proves that the global relations observed in galaxies have a local counterpart.