A planetary nebula is an astronomical phenomenon that occurs when a star, similar in mass to the Sun, exhausts its nuclear fuel and expels its outer layers into space, creating a glowing shell of ionized gas. This process marks the transition of the star into a white dwarf, providing insights into stellar evolution and the chemical enrichment of the galaxy.