Water is returned to Earth's interior at subduction zones. However, the processes and pathways by which water leaves the subducting plate and causes melting beneath volcanic arcs are complex; the source of the water - subducting sediment, altered oceanic crust, or hydrated mantle in the downgoing plate - is debated; and the role of slab temperature is unclear. Here we analyse the hydrogen-isotope and trace-element signature of melt inclusions in ash samples from the Cascade Arc, where young, hot lithosphere subducts. Comparing these data with published analyses, we find that fluids in the Cascade magmas are sourced from deeper parts of the subducting slab - hydrated mantle peridotite in the slab interior - compared with fluids in magmas from the Marianas Arc, where older, colder lithosphere subducts. We use geodynamic modelling to show that, in the hotter subduction zone, the upper crust of the subducting slab rapidly dehydrates at shallow depths. With continued subduction, fluids released from the deeper plate interior migrate into the dehydrated parts, causing those to melt. These melts in turn migrate into the overlying mantle wedge, where they trigger further melting. Our results provide a physical model to explain melting of the subducted plate and mass transfer from the slab to the mantle beneath arcs where relatively young oceanic lithosphere is subducted.