Stars shine because energy is produced in their interiors through fusion. The fusion material in the core eventually runs out and the stellar structure changes. This is the beginning of a new evolutionary phase, as stars become red giants.
Fig. 1 Cartoon of a Hertzsprung–Russell diagram showing the typical evolution of a star with the same mass as the sun.
The last red giant stage is the Asymptotic Giant Branch (AGB). In AGB stars the fusion processes takes place in hydrogen and helium burning shells around an inert core of carbon and oxygen. Even though these stars can have the about the same mass as the sun, they have a radii that are several hundred times larger and shine a thousand times brighter.
AGB stars are long-variable pulsators, with typical pulsation periods of 100-1000 days. During a pulsation cycle the variation in brightness is drastic, up to several orders of magnitude in visual light. This is what initially made this type of stars famous, and the first observed AGB stars was named “Mira”, Latin for 'wonderful' or 'astonishing'.
Fig. 2 A computer model of an AGB star, showing the surface brightness.
During the AGB stars develop intense surface winds, which eventually expel the full atmosphere and stellar envelope. The wind builds up a gaseous cloud or circumstellar envelope (CSE) around the star. Eventually the wind will expel much of the stellar material, and when the atmosphere and stellar envelope has been blown off the star evolves into a white dwarf.