The only thing holding the star up was the energy of the fusion reactions, so as power levels go down, the star starts to shrink. And as it shrinks, the pressure goes up, and the temperature goes up, until suddenly it hits a temperature where a new reaction can get started. These new reactions give it a big burst of energy, but start to form heavier elements still, and so the cycle gradually repeats, with the star reacting further and further up the periodic table, producing more and more heavy elements as it goes. Until it hits 56. At that point, the reactions simply stop producing energy at all; the star shuts down and collapses without stopping.
As soon as the star hits the 56 nucleon (total number of protons and neutrons in the nucleus) cutoff, it falls apart. It doesn’t make anything heavier than 56. What does this have to do with red paint? Because the star stops at 56, it winds up making a ton of things with 56 neucleons. It makes more 56 nucleon containing things than anything else (aside from the super light stuff in the star that is too light to fuse).
The element that has 56 protons and neutrons in its nucleus in its stable state? Iron. The stuff that makes red paint.
And that, Zunger explains, is how the death of a star determines what color barns are painted.