Stellar nucleosynthesis is the process by which stars create new elements through nuclear fusion. Inside a star, extreme temperatures and pressures allow hydrogen atoms to combine and form helium, releasing energy in the process. This energy powers the star and creates the light we see from Earth. As stars evolve, they can fuse heavier elements, producing carbon, oxygen, and even iron.
When massive stars reach the end of their life cycle, they explode in a supernova, scattering these newly formed elements into space. This enriches the surrounding gas and dust, contributing to the formation of new stars, planets, and even life, as seen with Earth and its carbon-based life forms.