There is strong observational evidence (and supporting physical modeling) showing that stars and their planetary systems form from the collapse of immense interstellar gas and dust clouds, similar to the Horsehead Nebula and Pipe Nebula. Our solar system formed from the collapse of such a cloud, and radiometric dating of the oldest meteorites puts the date of formation at about 4,568 million years ago (give or take a million years or so!).
The solar system’s birth cloud contained about 72 percent hydrogen, 27 percent helium, and only about 1 percent of all the heavier elements (colloquially called “metals” by astronomers). That hydrogen, and most of the helium and lithium, was produced in the Big Bang about 13.8 billion years ago, but had been incorporated into our Milky Way Galaxy. While the Big Bang was hot enough and dense enough in the first half hour for nuclear reactions to form hydrogen and helium, the density of the expanding universe was actually too low to fuse the heavier elements. The formation of the “metals” would have to await an even denser furnace — the cores of dying stars.
Stars fuse lighter elements into heavier elements, releasing energy. At the end of their lives, stars return some of their nuclear waste (helium and heavier elements) back into our galaxy’s interstellar gas, either via planetary nebulae (for lower-mass stars) or through stellar winds and supernovae (for higher-mass stars and some binary stars). So the “metals” and some of the helium were mostly produced by many generations of stars that lived and died between the formation of the first stars in the Milky Way, more than 13 billion years ago, right up until the time of the solar system’s formation. Indeed there is evidence from meteorites that nearby stars exploded as supernovae and injected their own radioactive elements into the Sun’s proto-cloud.
University of Rochester