The baryon cycle in the Eagle simulations