Have you ever noticed that almost every barn you have ever seen is red? There’s a reason for that, and it has to do with the chemistry of dying stars. Seriously.

Yonatan Zunger is a Google employee who decided to explain this phenomenon on Google+ recently. The simple answer to why barns are painted red is because red paint is cheap. The cheapest paint there is, in fact. But the reason it’s so cheap? Well, that’s the interesting part.

Red ochre—Fe2O3—is a simple compound of iron and oxygen that absorbs yellow, green and blue light and appears red. It’s what makes red paint red. It’s really cheap because it’s really plentiful. And it’s really plentiful because of nuclear fusion in dying stars. Zunger explains:

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.