During the Permian, much of Gondwana gripped in an ice age. The ice sheets from the
main land carried tonnes of glacial sediment. As the ice sheet encountered the ocean,
it broke into icebergs, floated out to sea, and dumped much of the sediment on the
continental shelf, slope, and in the submarine trench. This sediment continued to be
scraped off and stacked up by the movement of the subduction zone until it was eventually
accreted to Gondwana. This "gummed up" the subduction zone and caused it to do a "sideways
step" towards the ancient ocean. The rocks created during this time make up 2/3 of the
rock found in New Zealand today.
All of this accreted sediment weighed down the continent. It eventually righted iteself, causing these mountain chains to rise from the ocean during the Rangitata Orogeny.
The image shows the orientation of the continents during the Permian (260 million years ago).