Gaia collects data about the composition of distant stars using a technique called spectroscopy, with its instrument called the Radial Velocity Spectrometer (via ESA). Spectroscopy works by breaking down light into different wavelengths, such as the rainbow of colors you see when light passes through a prism. By breaking down the light in this way, sensors on the spacecraft can detect which wavelengths of light are absent. These correspond to certain elements, which absorb light at particular wavelengths. For this reason, you can tell what light a distant star is made of (via Gaia).
This has allowed Gaia to create a color-coded representation of the stars in the Milky Way, showing what percentage of the heavy elements each star consists of. This information – which astronomers call the metallicity of a star – is useful because young stars have high metallicity. This is because older stars are composed of simpler elements such as hydrogen and helium, and they form heavier elements by nuclear fusion. When these stars die, they release these heavy elements that later become new, smaller stars.
So by looking at which regions have high or low metallicity stars, researchers can see how our galaxy has evolved over time. “Therefore, a star’s chemical composition is similar to that of its DNA, which gives us important information about its origin,” writes ESA. “With Gaia, we see that some stars in our galaxy are made of primitive material, while other stars such as our Sun are made of material enriched by previous generations of stars. Stars closer to the center and bottom of our galaxy than stars. are rich in metals. At a greater distance.”