We describe an equilibrium model that links the metallicity of low-redshift galaxies to stellar evolution models . It enables the testing of different stellar initial mass functions and metal yields against observed galaxy metallicities . We show that the metallicities of more than 80,000 Sloan Digital Sky Survey ( SDSS ) galaxies in the low-redshift range 0.07 \leq z \leq 0.3 considerably constrain stellar evolution models that simultaneously relate galaxy stellar mass , metallicity , and star formation rates ( SFRs ) to the infall rate of low-metallicity extragalactic gas and outflow of enriched matter . A feature of our model is that it encompasses both the active star forming phases of a galaxy and epochs during which the same galaxy may lie fallow . We show that the galaxy-mass-metallicity-star-formation relation can be traced to infall of extragalactic gas mixing with native gas from host galaxies to form stars of observed metallicities , the most massive of which eject oxygen into extragalactic space . Most consequential among our findings is that , on average , extragalactic infall accounts for one half of the gas required for star formation , a ratio that is remarkably constant across galaxies with stellar masses ranging at least from M* = 2 \times 10 ^ { 9 } to 6 \times 10 ^ { 10 } M _ { \odot } . This leads us to propose that star formation is initiated when extragalactic infall roughly doubles the mass of marginally stable interstellar clouds . The processes described may also account quantitatively for the metallicity of extragalactic space , though to check this the fraction of extragalactic baryons will need to be more firmly established .