We examine mass–metallicity relations for nearby (D < 2 Mpc) gas-rich and gas-poor dwarf galaxies. We derived stellar and baryonic masses using photometric data and used average stellar iron abundances as the metallicity indicator. With the inclusion of available data for massive galaxies, we find a continuous mass–metallicity relation for galaxies spanning nine orders of magnitude in mass, and that the mass–metallicity relations are the same for both gas-rich and gas-poor dwarf galaxies. We derive stellar effective yields from the stellar abundances, finding that gas-poor dwarf galaxies form a single sequence with mass, whereas gas-rich dwarf galaxies have higher yields at comparable mass. Simple chemical evolution models show that a mass-dependent star-formation efficiency can simultaneously account for the correlations between metallicity, gas fraction, and stellar effective yield with mass. In agreement with recent and independent results, we conclude that a key driver of the mass-metallicity relation is the variation of star-formation efficiency with galaxy mass, modulated by galaxy mass-dependent outflows and/or stellar IMF variations, and coupled with environmental gas-removal processes.