There are lots of possible ways that stars can end their life, even in the subset of cases where the end is violent. @Eloff has given an excellent answer, but I wanted to add a few points.
You need the right conditions (mass, angular momentum, metallicity, etc) to produce a proto-neutron-star which is able to resist complete collapse to a black-hole. The bounce from hitting that proto-neutron-star surface, and the heating from neutrinos, is what drives the explosion of material. Radioactivity is eventually the source of the light we see from supernovae.
The basic picture for producing a supernova from a massive star1:
1: The star burns progressively heavier elements on shorter timescales until producing iron (Fe) on the timescale of seconds.
2: After iron, fusion in the core ceases, and pressure support is lost. Gravity is unhindered, and the star begins dynamical collapse.
3: As the Fe-core contracts, electron-capture begins to convert protons + electrons into neutrons, emitting GeV neutrinos.
4: The Fe-core, now largely composed of neutrons is stabilized to further collapse by neutron degeneracy pressure at nuclear densities.
5: Material further out, which is still collapsing, hits the incredibly hard proto-neutron-star surface - causing a bounce (see video analog): the launch of a powerful shockwave outwards through the star.
6: Because the neutrinos produced from electron-capture are so energetic (as @dmckee points out), and because the densities are so high - the neutrinos are able to deposit significant amounts of energy into the outer-material, accelerating it beyond escape velocities. This is the supernova explosion.
7: Due to the hot, dense, nucleon-rich nature of the ejecta, r(apid)-process nucleosynthesis produces radioactive Nickel (Ni) and Cobalt (Co).
8: After roughly 10's of days, the expanding supernova ejecta becomes optically thin - allowing the radiation produces by Ni and Co decay to escape - this causes the optical emission we call a supernovae.
Why does a supernovae explode?
All massive stars are not believed to produce supernovae when they explode. In the following figure (which is intended to convey the basic idea - but not necessarily the quantitative aspects), regions titled 'direct black-hole formation' are regions of initial mass where the neutron-degeneracy pressure (stage '4' above) is insufficient to halt collapse. The Fe core is massive enough that it continues collapsing until a black-hole is formed, and most of the material further out is rapidly accreted.
The region in this plot between about 8 and 35 solar masses is where the vast majority of observed supernovae are believed to come from.
To answer why supernovae explode: Consider the schematic process outlined above. The reason why some deaths-of-massive-stars explode and others don't, is that you need the right conditions (mass, angular momentum, metallicity, etc) to produce a proto-neutron-star which is able to resist complete collapse. The bounce from hitting that proto-neutron-star surface, and the heating from neutrinos is what drives the explosion of material. Radioactivity is eventually the source of the light we see from supernovae.
1: This discussion is constrained to 'core collapse' supernovae - the collapse of massive stars, observed as type Ib, Ic, and type II supernovae
Basically any paper by or with Stan Woosley, e.g.