The life cycle of a banana is a colorful one—it starts with a deep green, changes to a delicious yellow, and ends (if it’s not eaten beforehand) at an unappetizing brown. But what causes this color change, and what makes a banana go from green all the way to the dark side? As it turns out, bananas are a little too gaseous for their own good.

Bananas, like most fruits, produce and react with an airborne hormone called ethylene that helps to signal the ripening process. A fruit that is unripened is hard, is more acidic than it is sugary, and likely has a greenish hue due to the presence of chlorophyll, a molecule found in plants that is important in photosynthesis. When a fruit comes into contact with ethylene gas, the acids in the fruit start to break down, it becomes softer, and the green chlorophyll pigments are broken up and replaced—in the case of bananas, with a yellow hue. The loss of the acidic taste and hardened interior means a sweeter, yummier, and mushier fruit—perfect for eating!

However, unlike most fruits, which generate only a tiny amount of ethylene as they ripen, bananas produce a large amount. While a banana in the beginning of the ripening process might become sweeter and turn yellow, it will eventually overripen by producing too much of its own ethylene. High amounts of ethylene cause the yellow pigments in bananas to decay into those characteristic brown spots in a process called enzymatic browning. This natural browning process is also observed when fruits become bruised. A damaged or bruised banana will produce an even higher amount of ethylene, ripening (and browning) faster than if undamaged. It seems like your grandma was right—a green banana that’s placed in a brown paper bag will ripen faster because of all the ethylene trapped inside. But if the fruit is subjected to its own gaseous prison for too long, it will ripen itself all the way to rot.