Final answer:
Elements heavier than hydrogen are scattered throughout the universe when a massive star explodes as a supernova, ejecting matter enriched in heavy elements into interstellar space. This matter can be used to form new stars, resulting in each succeeding generation of stars containing a larger proportion of elements heavier than hydrogen and helium.
Step-by-step explanation:
A massive star explodes as a supernova, releasing elements heavier than hydrogen into the cosmos. Nuclei as heavy as iron can be created in stars with masses greater than roughly 8 solar masses through nuclear reactions involving carbon, oxygen, and even heavier elements. When a massive star reaches the end of its life, its energy reserves run out and its core collapses. This results in a supernova explosion that blasts matter rich in heavy elements into interstellar space. Then, by using these heavy elements to create new stars, the fraction of elements heavier than hydrogen and helium increases in every generation of stars that follows.