How stars radiate (emit light)
The spectrum that each star emits is different. The differences depend on when and where they were created, their age and mass.
All stars are primarily made up of hydrogen, with small amounts of helium and carbon. Stars that were created a long time ago were made when there weren’t many heavier elements, such as carbon and oxygen (astronomers like to call these elements “metals,” even though they aren’t like the metal we know on Earth), and so they have very simple absorption and emission profiles.
During these star's lifetimes some of these heavier elements were created, and at the death of the star they were scattered back out into the interstellar medium. This cycle continues on, with each generation of stars getting more and more polluted with heavier elements. Knowing this, astronomers can look at a star's spectrum and be able to determine how long ago it was formed. The more recently the star was formed, the more metal rich it is.
All stars are primarily made up of hydrogen, with small amounts of helium and carbon. Stars that were created a long time ago were made when there weren’t many heavier elements, such as carbon and oxygen (astronomers like to call these elements “metals,” even though they aren’t like the metal we know on Earth), and so they have very simple absorption and emission profiles.
During these star's lifetimes some of these heavier elements were created, and at the death of the star they were scattered back out into the interstellar medium. This cycle continues on, with each generation of stars getting more and more polluted with heavier elements. Knowing this, astronomers can look at a star's spectrum and be able to determine how long ago it was formed. The more recently the star was formed, the more metal rich it is.