A supernova explosion occurs when a massive star reaches the end of its life and undergoes a catastrophic collapse or a violent explosion. This can happen in two ways: through the fusion of heavier elements in the star's core or the sudden ignition of nuclear fusion in a white dwarf in a binary star system .