Source: USGS Earthquakes
In geology 101 we learn that most earthquakes take place at plate boundaries where the crust is being stressed and actively deformed. Earthquakes away from plate boundaries are not uncommon though. In India in recent memory the two big earthquakes around Bhuj Gujarat and Killari Maharastra are example of earthquakes which took place a long distance away from plate boundaries. The reasons for these intra-plate earthquakes can be usually traced to stress transmitted across plates from zones of plate boundary interaction. The Indian crust in under a compressional stress regime resulting from the collision of India with Eurasia. These compressional stresses can reactive ancient zones of weakness within the Indian plate causing slippage along old faults resulting in earthquakes. The Bhuj earthquake is thought to have occurred along zones of crustal weakness which originated during Mesozoic rifting and basin formation in the Gujarat region of India. Geologic studies show compressional ridges following the same trend as ancient graben structures suggesting that pre-existing zones of weaknesses are now being reactivated like old injuries flaming up during periods of stress. The reason for the Killari earthquake is less clear but a fair guess is that the Deccan Traps at that location sits on very ancient zones of weakness in the Indian crust which originated during the formation of Proterozoic mobile belts of south India. Just like the Indian plate, the Tibetan plateau which is part of the Asian plate, is also under a compression stress regime imposed by the continent-continent collision of India with Eurasia. Although some distance away from the zone of collision, the earthquake at Sichuan needs to be understood in this larger plate tectonic context.
Imagine a square block of dough say 6 inches thick and a foot across representing the Tibetan plateau. Now if you place one hand against one side of the square and drive your fist slowly into the dough from the other side, the dough will respond by thickening and also flowing in a direction perpendicular to the direction of the force you are putting against the dough. The dough has accommodated the shortening by thickening and flowing laterally. That is more or less what is happening to the Tibetan plateau is response to the NNE -SSW compressional stresses imposed by the plate collision. As India penetrates into Asia, the thick crustal material on the Asian plate is flowing eastwards out of India's path. Dont be misled by the term flow. The crust is not flowing like a liquid. The upper crust does break in a brittle manner and easterly movement (flow) of Tibetan crust occurs along faults in this case strike slip and normal faults . At depth the lower crust deforms as a continuous medium more like the dough model I presented. The rates of flow are a few 10's of mm per year. In a recent study by a group of Chinese and American geologists, a array of Global Positioning System locations measuring crustal velocities all over the Himalayas and the Tibetan plateau shows this flow of Tibetan crust with remarkable clarity. See map below. Thin blue arrows denote crustal velocities and direction of flow. Northerly flow dominates in the south central part of the Himalayas and the Tibetan plateau. Further north and east the crust is flowing eastwards towards Sichuan and rotating clockwise and flowing southerwards along the eastern syntaxis of the Himalayas.
I really like this depiction of plate movements. The simple arrows and a land cover map draped over a topographic relief model of the earth helps you vizualize continental scale crustal flow and the resulting deformation of the earth's surface into the many crinkles, wrinkles and elevated areas, something that is not always easy to achieve with geological maps cluttered with necessary but utilitarian symbology. Coming back to the tectonics, this easterly flow of the Tibetan crustal material comes up against stronger crust in the Sichuan basin area. The resistance between the Sichuan basin and the Tibetan plateau results in compressive stresses and thrust faulting along the boundary between the two crustal blocks. The Longmenshan fault is one such thrust fault zone along which the Tibetian plateau is riding over the Sichuan basin. A more conventional map below shows the various tectonic features and fault movements in the Tibetan plateau and along its margins. Blue arrows indicated compression and shortening along the margins of the plateau. Purple arrows indicate shortening in the interior of the plateau. Open black arrows indicate relative motion of crust with respect to stable Eurasia.
So the short answer to why was there an earthquake in eastern Sichuan would be that the earthquake was a result of the building up of stress along the Longmenshan fault in response to the convergence of the Tibetan crust against stronger crust underlying the Sichuan basin. High population density, poor construction and environmental damage in the form of deforestation has led to extraordinary losses in terms of lives and property. It could have been worse. Chengdu, a city of 4 million is just 60 km southeast of the epicentre but may have been spared more extensive damage since it sits of the less disrupted footwall of the longmenshan fault and also because the northeast rupture direction of the fault put most of the rupture energy away from Chengdu. Large areas of China , southeast Asia and India fall under high seismicity risk zones. Often the remote locations and steep terrains especially in the Himalayan and Tibetian regions exacerbate the damage by making rescue efforts difficult . A more rigorous and structured earthquake damage management and mitigation plan needs to be put in place. But I sometimes wonder if scientific risk assessement whether of earthquakes or hurricanes will make any difference to human habitation patterns. By choice people are moving in large numbers to live next to active faults like the San Andreas in California or in the path of hurricanes as in Florida and Louisiana. In the Himalayas and Tibet people have little or no choice on where to live. Regardless of the risks they live where they have always lived on their ancestral lands. I don't see that pattern changing in the near future. NPR has USGS seismologist Walter Mooney giving a good talk on predicting aftershocks or rather how there is no real way to predict them and how stress changes along the Longmenshan fault zone after the big earthquake can trigger later earthquakes.