Recent galaxy formation models have demonstrated the that galaxy evolution is driven by effects in addition to those associated with star formation and stellar evolution. In particular, the growth of the central black hole and the mass of the parent dark halo can strongly influence the formation of stars and the gas content of galaxies. I will review some recent observational studies of the relation between AGN and their host galaxies and environments, and will discuss which evolutionary phases and classes of AGN are responsible for the bulk of the energy input into galaxies. I will then outline some recent work on the spatial clustering of star-forming galaxies selected in the mid-infrared and submm to constrain the influence of halo mass on different phases of star formation.