In the standard Big Bang model, the universe evolved from a state in which it was extremely hot, dense, and opaque, and it has been expanding (and cooling) ever since. In the cosmos’ early history, protons, electrons, and neutrons repeatedly scattered and absorbed photons, the particles of radiation. Those interactions brought the radiation into a state of thermal equilibrium (physicists call this “black body” radiation). In this thermal equilibrium, light has a specific energy profile, or spectrum — once we measure the radiation’s intensity at any wavelength along this profile, we immediately know the intensity at any other wavelength.
Astronomy magazine subscribers can read the full answer for free. Just make sure you're registered with the website.