Dynamic buckling of subducting slabs reconciles geological and geophysical observations