Final answer:
After leaving the main sequence, a star begins fusing hydrogen in a shell outside the core and undergoes expansion to become a red giant. Its structure becomes layered with different fusion processes occurring at various depths. Eventually, helium in the core fuses into carbon and oxygen, leading to various endpoints depending on the star's initial mass.
Step-by-step explanation:
After a star leaves the main sequence, it experiences significant changes in its core and outer layers. The hydrogen in the core is exhausted, and the core itself is composed mainly of helium. As the core contracts and heats up under gravity's pull, temperatures rise, leading to the onset of hydrogen fusion in a shell surrounding the core. This process is essentially the star moving from the main sequence to a new phase in its stellar evolution, where it typically becomes larger and brighter, known as a red giant.
The star develops a complex, multi-layered structure similar to an onion, with a carbon-oxygen core, surrounded by a shell where helium fusion occurs. This is enveloped by a layer of helium, then a shell where fresh hydrogen fuses into helium, and the extended outer layers of the star. As energy flows outward from the fusion shells, the outer regions expand, contributing to the star's swelling into a red giant.
Following the main sequence, the star will continue fusion in various shells until it reaches the point where the helium in the core starts to fuse into carbon and oxygen through the triple-alpha process. For less massive stars, the process stops there, while more massive stars will go through additional fusion cycles, eventually leading to the formation of heavier elements before reaching the end of their evolutionary cycle.