The Core and the Envelope

In the subsequent discussion, it is very important to distinguish what happens in the core of the star and what happens in the outer regions of the star (the envelope). The latter is governed by the former, but the behaviors in some stages will be completely different. For example, we will find that contraction and heating of the core often leads to expansion and cooling of the outer layers.

So when we talk about expansion and contraction or heating and cooling, be sure that you understand whether we are discussing the central energy-producing region, or the outer layers that respond to energy transported out from the central region.

Evolution Away from the Main Sequence

While core hydrogen fusion continues, a star drifts slightly in luminosity and temperature on the HR diagram. But this effect is small and the star remains within the main sequence band.
Helium Ash
However, as the hydrogen burns in the core (which is the only place it can burn because only there are the temperatures and densities high enough), it produces a helium "ash". The helium cannot fuse at these temperatures, so it accumulates steadily in the core. Eventually, there is essentially no hydrogen left inside the critical radius where temperature and density permit fusion to occur. When this happens, the star undergoes a series of changes that will take it rapidly away from the main sequence.
Contraction of the Core
When the fusion reactions begin to turn off, the advantage switches to gravity in the relentless struggle between pressure and gravity, and the core of the star begins to contract. Because it is contracting, the star now produces energy both by the fusion that is still going on and by conversion of gravitational potential energy to kinetic energy (the Kelvin-Helmholtz mechanism discussed earlier). This raises the temperature in the center, and as this energy is transported outward it heats the layers surrounding the core to higher temperatures. This sets the stage for hydrogen to begin fusing in a new region: a concentric shell surrounding the original core fusion region. This is called shell burning.