system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:What is the exact mechanism by which an implosion of a dying star becomes an explosion?
gpt
To understand supernovae you need to understand some basic gas laws and nuclear fusion.

First of all the gas laws. Gas expands when you heat it up (see, hot air balloons). The reverse is also true: Compressing gas will heat it up. If you confine expanding gas, it has nowhere to go and it'll cause the pressure to rise.

Now for the fusion. Fusion is what happens when you heat up a plasma to ridiculous temperatures and the nuclei begin to combine. For light elements this releases energy in the form of heat (actually radiation, but it'll be absorbed by the star and converted into heat). The crucial bit that allows supernovae to happen is that heavier cores cost energy to fuse. If you try to fuse anything heavier than iron you're bleeding away energy.

So let's look at a heavy star. As it forms from its initial gas cloud gravity is essentially compressing the star. This heats it up and increases the pressure as per the gas laws. At some point the temperature and pressure are so big that hydrogen fusion begins. This dumps additional heat into the star to further increase the pressure and a balance forms. The extra energy from the fusion counteracts the force of gravity.

The core of the star is the hottest bit, so fusion will be most intense there. This means that the core runs out of hydrogen pretty quickly. No hydrogen means no fusion, so the star will shrink and increase the temperatures. Higher temperatures allows helium fusion, which again counteracts the gravitational force. So now we have a core of helium fusion, surrounded by a shell of hydrogen fusion.

This little game continues for several steps as the star burns through its elements. You get an onion like structure with the heaviest elements fusing in the core and shells of other types of fusion around it. This continues until the star reaches iron. Now the star has a problem, fusing iron does not produce energy but instead it consumes it. So the star builds up iron in its core and depletes its supply of fuel until a crucial point is reached where iron fusion starts. Now the balance is broken: the star shrinks a bit, the core heats up, iron starts to fuse, core cools down, star shrinks some more. This happens incredibly quick as the entire core collapses at a significant fraction of lightspeed. The core reaches ridiculous temperatures and ever more exotic elements are produced. This continues until the entire core is converted into neutrons and kept from collapsing by neutron degeneracy pressure (neutron star), or the collapse just never stops and you end up with a black hole.

The supernova occurs because of the layers above the core. These contain elements that can still provide energy when fused. Normally this energy is released at a slow burn. But now the core is suddenly gone, and all these layers suddenly fall towards the center. When they collide against each other in the middle the resulting temperatures causes runaway fusion reactions in these light elements. This energy is what fuels the supernova. The spike in energy is much bigger than the gravitational binding energy of the entire star and it tears itself apart. The outer layers blast off at a significant fraction of the speed of light to form a nebula, leaving behind the remains of the core.