We present a simple, redshift-independent analytic model that explains the local fundamental metallicity relation (FMR), taking into account the physical processes of star formation, inflow of metal-poor intergalactic medium (IGM) gas, and the outflow of metal-rich interstellar medium (ISM) gas. We show that the physics of the FMR can be summarized as follows: for massive galaxies with stellar mass M* ≥ 1011 M☉, ISM metal enrichment due to star formation is compensated by inflow of metal-poor IGM gas, leading to a constant value of the gas metallicity with star formation rate (SFR); outflows are rendered negligible as a result of the large potential wells of these galaxies. On the other hand, as a result of their smaller SFR, less massive galaxies produce less heavy elements that are also more efficiently ejected due to their shallow potential wells; as a result, for a given M*, the gas metallicity decreases with SFR. For such galaxies, the outflow efficiency determines both the slope and the knee of the metallicity-SFR relation. Without changing any parameters, this simple model is also successfully matched to the gas fraction-gas metallicity relation observed for a sample of about 260 nearby galaxies.