How did the Canterbury New Zealand earthquake happen?

New Zealand lies across the intersection of two of Earth's tectonic plates - those of the Indo-Australian Plate, and the Pacific Plate. Thus the country is riven by any fault systems. (Of which the most famous is the Alpine Fault.)

The stresses produced by the differential movement between and within these plates causes New Zealand's earthquakes. (In addition, the deep earthquakes are caused by subduction processes at the plate intersection.

The Christchurch Earthquakes were caused primarily by earthquakes associated with stresses in the shallow crust.