The earthquake on November 7th, 2012 was a result of thrusting on or near the interface between the Cocos Plate and the over-riding Caribbean and North American plates.
The Cocos plate moves north-northeast with respect to the Caribbean and North American plates at a velocity of ~70-80 mm per year, sub ducting beneath Central America at the Middle American Trench.
Further information about this and other earthquakes can be found at the USGS Earthquakes Hazards Program