A gross simplification of where heavier elements come from, but basically as we look beyond how stars produce energy by fusing hydrogen into helium, we need to look to supernova for the production of elements like oxygen, carbon, sulfur silicon and iron. This is the “star stuff” Carl Sagan referred to.
But while its easy to write that super nova create heavy elements such as iron and billions of years from now, new solar systems and planets will be created from these elements, there are many questions. For example, Cassiopeia blew up as a supernova, 11,000 years ago, but now scientist are examining it with newer technologically advanced telescopes and they are not finding the iron they were expecting to see. The view of iron might have been blocked by titanium also create by the super nova, or there might be something else going on. https://www.nasa.gov/image-article/case-of-missing-iron-cassiopeia/
Additional information about Cassiopeia A and what the James Webb Telescope can see of this remnant.
https://webbtelescope.org/contents/media/videos/2023/149/01HH3QHZ4F3JXEGDXWS2SS2MVR?news=true
As more data from our new and old telescopes become available collective learning kicks in as scientist around the world study and discuss their findings. All this work requires abundant energy to fuel this heighten complexity.
https://phys.org/news/2017-06-radioactive-elements-cassiopeia-neutrino-driven-explosion.html