Call

Galaxies early on in their lives are actively forming hot, new stars and appear more bluish. Older galaxies are forming fewer new stars and their constituent stars are older on average so appear more reddish.

There are complicating factors ... intervening dust and gas to name but two, but this is it in a nutshell.