Original: At the end of the star's life, during the red giant phase, the outer layers of the star are expelled via pulsations and strong stellar winds.
Simplified: At the end of a normal-sized star's life, in the red giant phase, the outside layers of a star are thrown out.