As an oceanic plate descends to hotter depths beneath the overriding plate, it is heated and releases water. The presence of hot, water-rich liquids causes the overlying rock to begin melting. The resulting magma is less dense than the surrounding rock, so it rises up toward the surface where it collects in magma chambers. Volcanic eruptions happen when magma from these chambers reaches the surface. Over millions of years, repeated eruptions build volcanic mountains on the overriding plate.
! Click the image to see the animation.