Nucleosynthesis is the process by which elements are formed in stars through nuclear reactions. In the cores of stars, extreme temperatures and pressures allow hydrogen atoms to fuse together, creating helium and releasing energy. This energy powers the star and can lead to the formation of heavier elements like carbon and oxygen as the star evolves.
When massive stars reach the end of their life cycles, they can explode in a supernova, scattering these newly formed elements into space. This process enriches the surrounding interstellar medium with elements that eventually form new stars, planets, and even life, making nucleosynthesis a key part of the cosmic cycle.