Abstract: According to the cosmological numerical simulations of galaxy formation, cosmic gas accretion sets the rate of galaxy growth. This ingredient is both central to the theory of galaxy formation, and extremely elusive observationally. One of the best observational supports for this theoretical framework is the fact that galaxies follow the so-called fundamental metallicity relation (FMR; Mannucci+10, Lara-Lopez+10), so that galaxies of the same stellar mass but larger star formation rate (SFR) have smaller gas-phase metallicity (Zg). It is thought to be fundamental because it naturally arises from the stochastic feeding of star-formation from the external metal-poor gas accretion predicted by the models. I will present two recent works of our group on the FMR. First, most star-forming galaxies of the nearby universe (as portrayed by MaNGA) show a local anti-correlation between SFR surface density and Zg (Sanchez-Menguiano+19). Locally enhanced star formation is associated with a drop in metallicity. Second, we prove that the FMR follows from the spatial integration of this local anti-correlation (Sanchez Almeida+19). Local and global laws agree when considering the star-forming galaxies in MaNGA. Thus, understanding the FMR becomes equivalent to understanding the origin of the drop in metallicity of the most actively star-forming regions of each galaxy.