  We investigate the balance of power between stars and AGN across cosmic
history, based on the comparison between the infrared (IR) galaxy luminosity
function (LF) and the IR AGN LF. The former corresponds to emission from dust
heated by stars and AGN, whereas the latter includes emission from AGN-heated
dust only. We find that at all redshifts (at least up to z~2.5), the high
luminosity tails of the two LFs converge, indicating that the most
infrared-luminous galaxies are AGN-powered. Our results shed light to the
decades-old conundrum regarding the flatter high-luminosity slope seen in the
IR galaxy LF compared to that in the UV and optical. We attribute this
difference to the increasing fraction of AGN-dominated galaxies with increasing
total infrared luminosity (L_IR). We partition the L_IR-z parameter space into
a star-formation and an AGN-dominated region, finding that the most luminous
galaxies at all epochs lie in the AGN-dominated region. This sets a potential
`limit' to attainable star formation rates, casting doubt on the abundance of
`extreme starbursts': if AGN did not exist, L_IR>10^13 Lsun galaxies would be
significantly rarer than they currently are in our observable Universe. We also
find that AGN affect the average dust temperatures (T_dust) of galaxies and
hence the shape of the well-known L_IR-T_dust relation. We propose that the
reason why local ULIRGs are hotter than their high redshift counterparts is
because of a higher fraction of AGN-dominated galaxies amongst the former
group.
