Planetary nebulae are the final butterfly-like state that heralds the end of a Sun-like star's energy-generating life. They form when stars up to eight times the mass of the Sun begin to die, bloating into red giants before shedding as much as half their mass as gas and dust nebulae.