Final answer:
As a star ages, it goes through different stages of fusion, including a helium flash and fusion in shells around the core. Eventually, the star sheds its outer layers, creating planetary nebulae.
Step-by-step explanation:
As a star ages, its core slowly converts hydrogen to helium through fusion. Initially, the fusion of three helium nuclei produces carbon through the triple-alpha process. This process is known as the helium flash and results in the star becoming stable and reducing its luminosity and size briefly.
In low-mass stars, fusion stops after the helium in the core has been exhausted. However, fusion of hydrogen and helium in shells around the contracting core makes the star a bright red giant again, but only temporarily. Eventually, the star sheds its outer layers and exposes its hot inner layers, which are set glowing by the ultraviolet radiation of the dying central star, creating planetary nebulae.