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, magnesium, silicon, and iron. Most of the remaining 5% comes from aluminum, calcium, nickel, hydrogen, and sulphur. We know that the big bang made hydrogen, helium, and lithium, 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 some atoms fuse and that energy is what causes stars to shine.
It takes larger stars to make elements as heavy as iron and nickel. Our Sun is an average star; after it uses up its hydrogen fuel to make helium, and then some of that helium is fused to make small amounts of beryllium, carbon, nitrogen, oxygen, and fluorine, it will be at the end of its life. It will stop making atoms 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 and casting off newly formed atoms —including the elements heavier than iron — into space. It took many generations of stars creating heavier elements and casting them into space before heavier elements were abundant enough to form planets like Earth.
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.