The interplay between feedback, accretion, transport, and winds in setting gas-phase metal distribution in galaxies