Planetary nebulae mark the end of the active life of 90% of all stars. They trace the transition from a red giant to a degenerate white dwarf. Stellar models predicted that only stars above approximately twice the solar mass could form a bright nebula. But the ubiquitous presence of bright planetary nebulae in old stellar populations, such as elliptical galaxies, contradicts this: Such high-mass stars are not present in old systems. The planetary nebula luminosity function, and especially its bright cut-off, is almost invariant between young spiral galaxies, with high-mass stars, and old elliptical galaxies, with only low-mass stars. Here, we show that new evolutionary tracks of low-mass stars are capable of explaining in a simple manner this decades-old mystery. The agreement between the observed luminosity function and computed stellar evolution validates the latest theoretical modelling. With these models, the planetary nebula luminosity function provides a powerful diagnostic to derive star formation histories of intermediate-age stars. The new models predict that the Sun at the end of its life will also form a planetary nebula, but it will be faint. Fil: Gesicki, K.. Nicolaus Copernicus University; Polonia Fil: Zijlstra, A.A.. University of Manchester; Reino Unido Fil: Miller Bertolami, Marcelo Miguel. Consejo Nacional de Investigaciones Científicas y Técnicas. Centro Científico Tecnológico Conicet - La Plata. Instituto de Astrofísica La Plata. Universidad Nacional de La Plata. Facultad de Ciencias Astronómicas y Geofísicas. Instituto de Astrofísica La Plata; Argentina