The name "planetary nebula" might indicate planets are somehow involved, when it is actually a reflection of the way these objects appear when viewed through a small telescope (like a planet, naturally). In truth, these stellar nebulae are forged from the gases expelled during the final phase in a Sun-like star's life—when it transitions from a main sequence star, to the next phase of stellar evolution, which begins once the star depletes the hydrogen fuel at its core. This culminates in the star—generally weighing about 1 to 8 solar masses—expanding exponentially until it becomes more than one hundred times its previous size, effectively marking the beginning of the end for the now-red giant.
Ultimately, as the inexorable decline continues, the star's core will finally contract, leaving behind a small object around the size of Earth, but with the mass of the Sun. Besides the small remnant (called a white dwarf), the only other evidence a star once existed will be the brilliant planetary nebula (much like the ones pictured here) that remains, which glows brilliantly as a result of the white dwarf; It energizes the gas by expelling ultraviolet radiation, resulting in ionization.
One day, our Sun will die in a similar manner, so the properties of such nebulae paint a picture of the fate the Sun will meet in about 4 billion years.
Exceptions to the Rule:
Meet Abell 30 (also known as A30, for short): a planetary nebula located approximately 5,500 light-years from Earth in the constellation of Cancer.
This is no ordinary planetary nebula, though. Abell 30 is one of just three known nebulae called "born-again planetary nebulae."
Very rarely, nuclear reactions within the vicinity of a white dwarf—which, as I mentioned before, is responsible for generating the characteristic glow of planetary nebulae—can heat the gases to such high temperatures, the tiny star blooms into a red giant once more, but only for a while. The chain of events, which typically play out for a few hundred million years, hit fast-forward at this point (playing out in around 20 years), causing a small-scale planetary nebula to manifest inside the shell of the original—a resurrection of some sorts.
Astronomers estimate that the original nebula came into existence approximately 12,500 years ago, but many of its most distinct features are rather new--like the cloverleaf-esque pattern of knots in both lobes of Abell 30; They were likely formed by recently-ejected gas (primarily helium and other carbon-rich materials) from the star's "rebirth" about 850 years ago.
Also noted here are diffuse X-ray emissions observed by Chandra (in purple), which are caused by interactions between stellar winds, the star, and the central knots of the ejected gases. Astronomers are currently unsure of the source of the point-like X-ray emission around the central star. The Hubble Space Telescope captured optical emission from oxygen ions (in orange). The box in the upper right features optical light (mostly from oxygen and hydrogen, seen in green and blue) and X-ray data from the Kitt Peak National Observatory and ESA's XMM-Newton.
Learn more here.