Formation of volcanic arcs at the edge of continental plates