What stellar life stage results in the formation of a Planetary Nebula structure?

Answer

The final puffing off of outer layers by a medium-sized star after fuel exhaustion.

Planetary nebulae are stellar corpses, representing the concluding evolutionary phase for medium-sized stars, such as the one that powers our own solar system. When such a star has completely depleted its available nuclear fuel, it sheds its outer envelope of gas and dust into space. This expanding shell of material becomes illuminated by the intensely hot remnant left behind at the center—the exposed, dense core known as a white dwarf. This process results in a relatively short-lived, expanding structure that has no actual physical connection to planets, despite its traditional name.

What stellar life stage results in the formation of a Planetary Nebula structure?
Spaceastronomynebulagasdust