A nebula is a cloud of dust and gas in space. Some nebulae are giant clouds where new stars are being formed. A famous example is the Pillars of Creation inside the Eagle nebula, Messier 16.
A planetary nebula is a type of 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. The term originates from the planet-like round shape of these nebulae observed by astronomers through early telescopes. The first usage may have occurred during the 1780s with the English astronomer William Herschel who described these nebulae as resembling planets; however, as early as January 1779, the French astronomer Antoine Darquier de Pellepoix described in his observations of the Ring Nebula, "very dim but perfectly outlined; it is as large as Jupiter and resembles a fading planet". Though the modern interpretation is different, the old term is still used.
Spotted by Charles Messier in 1764, the Dumbbell Nebula or M27 was the first planetary nebula ever discovered. The nebula is the result of an old star that has shed its outer layers in a glowing display of color.