  We examine the origin and evolution of the mass-metallicity relationship
(MZR, M-Z) for galaxies using high resolution cosmological SPH + N-Body
simulations that include a physically motivated description of supernovae
feedback and subsequent metal enrichment. We discriminate between two sources
that may contribute to the origin of the MZR: 1) metal and baryon loss due to
gas outflow, or 2) inefficient star formation at the lowest galaxy masses. Our
simulated galaxies reproduce the observed MZR in shape and normalization both
at z=0 and z=2. We find that baryon loss occurs due to UV heating before star
formation turns on in galaxies with M_baryon < 10^8 M_sun, but that some gas
loss due to supernovae induced winds is required to subsequently reproduce the
low effective chemical yield observed in low mass galaxies. Despite this, we
show that low star formation efficiencies, regulated by supernovae feedback,
are primarily responsible for the lower metallicities of low mass galaxies and
the overall M-Z trend. We find that the shape of the MZR is relatively constant
with redshift, but that its normalization increases with time. Simulations with
no energy feedback from supernovae overproduce metals at low galaxy masses by
rapidly transforming a large fraction of their gas into stars. Despite the fact
that our low mass galaxies have lost a majority of their baryons, they are
still the most gas rich objects in our simulations due to their low star
formation efficiencies.
