A planetary nebula is a type of emission nebula consisting of an expanding, glowing shell of ionized gas ejected from red giant stars late in their lives.
The term "planetary nebula" is a misnomer because they are unrelated to planets. From Wikipedia