We use cosmological, hydrodynamical simulations from the EAGLE and OWLS projects to assess the significance of recycled stellar ejecta as fuel for star formation. The fractional contributions of stellar mass loss to the cosmic star formation rate (SFR) and stellar mass densities increase with time, reaching $35 \%$ and $19 \%$, respectively, at $z=0$. The importance of recycling increases steeply with galaxy stellar mass for $M_{\ast} < 10^{10.5}$ M$_{\odot}$, and decreases mildly at higher mass. This trend arises from the mass dependence of feedback associated with star formation and AGN, which preferentially suppresses star formation fuelled by recycling. Recycling is more important for satellites than centrals and its contribution decreases with galactocentric radius. The relative contribution of AGB stars increases with time and towards galaxy centers. This is a consequence of the more gradual release of AGB ejecta compared to that of massive stars, and the preferential removal of the latter by star formation-driven outflows and by lock up in stellar remnants. Recycling-fuelled star formation exhibits a tight, positive correlation with galaxy metallicity, with a secondary dependence on the relative abundance of alpha elements (which are predominantly synthesized in massive stars), that is insensitive to the subgrid models for feedback. Hence, our conclusions are directly relevant for the origin of the mass-metallicity relation and metallicity gradients. Applying the relation between recycling and metallicity to the observed mass-metallicity relation yields our best estimate of the mass-dependent contribution of recycling. For centrals with a mass similar to that of the Milky Way, we infer the contributions of recycled stellar ejecta to the SFR and stellar mass to be $35 \%$ and $20 \%$, respectively.