Supernovae are stellar explosions that occur when massive stars die. There are two main types of supernovae: Type Ia supernovae result from a white dwarf star absorbing material from a companion star, causing it to explode from exceeding critical density; Type II supernovae occur in very massive stars after nuclear fusion can no longer continue in their cores, causing gravitational collapse. Supernovae play an important role in enriching the interstellar medium with heavier elements and can trigger the formation of new stars by the expansion of shock waves.