If we were to take an inventory of the elements that make up Earth, we would find that 95% of Earth’s mass comes from only four elements: oxygen (O), magnesium (Mg), silicon (Si), and iron (Fe). Most of the remaining 5% comes from aluminum (Al), calcium (Ca), nickel (Ni), hydrogen (H), and sulphur (S). We know that the big bang made hydrogen, helium (He), and lithium (Li), but where did the rest of the elements come from?
The answer is that the other elements were made by stars. Sometimes stars are said to “burn” their fuel, but burning is not at all what is going on within stars. The burning that happens when wood in a campfire is turned to ash and smoke is a chemical reaction — heat causes the atoms that were in the wood and in the surrounding atmosphere to exchange partners. Atoms group in different ways, but the atoms themselves do not change. What stars do is change the atoms. The heat and pressure within stars cause smaller atoms to smash together and fuse into new, larger atoms. For example, when hydrogen atoms smash together and fuse, helium is formed. Large amounts of energy are released when atoms fuse within stars, and this is what causes stars to shine. Stars can form large quantities of elements as heavy as iron during their normal burning process. Side reactions can form heavier elements in small amounts.
It takes larger stars to make elements as heavy as iron in large quantities. Our sun is an average star. After it uses up its hydrogen fuel to make helium, and some of that helium is fused to make small amounts of other elements, it will be at the end of its life. It will stop making new elements and will cool down and bloat until its middle reaches the orbit of Mars. In contrast, large stars end their lives in spectacular fashion, exploding as supernovae, casting off newly formed atoms into space, and triggering side reactions to make even more heavy atoms. It took many generations of stars creating heavier elements and casting them into space before heavier elements were abundant enough for planets like Earth to form.
Until recently, astronomers have only been able to see stars that already contain heavier elements in small amounts, but not the first-generation stars that started out before any of the heavier elements were produced. That changed in June of 2015 when it was announced that a distant galaxy called CR7 had been found that contained stars made only of hydrogen and helium. The galaxy is so far away that it shows us a view of the universe from only 800 million years after the big bang.