Plate Collision in NZ
Earthquakes are a response to the motion between plates. As two plates push together at a steady rate, the rocks along the boundary become more and more stressed until eventually something has to give - and an earthquake occurs along a fault somewhere in the plate boundary zone. It's similar to bending a stick. As you bend it with increasing force, the stick becomes more and more deformed until eventually it breaks ("earthquake!") and each of the two pieces of the stick spring back to being more or less straight, but in a new position relative to each other.
In New Zealand, the Australian and Pacific Plates push against each other along a curving boundary. How they meet each other changes along the boundary. At the southern end of the South Island, the Australian Plate dives down (subducts) below the Pacific Plate whilst in the North Island the opposite situation occurs with the Pacific Plate being pushed under by the Australian Plate. In between, through most of the South Island, the two plates grind past each other along the Alpine Fault. To watch a video of how the plate boundary has changed over millions of years click here
The Hikurangi Trough marks the collision boundary to the east of the North Island, and is where oceanic lithosphere (the Pacific Plate) descends beneath the North Island as a huge inclined slab. As a result of this subduction, magmas are created at depth that give rise to New Zealand's active volcanoes.