Simply locating earthquakes on the globe shows a rough outline of plates and their boundaries. We can analyze earthquakes to describe the type or mechanism of plate-tectonic deformations. Finding a mechanism for plate-tectonic motions requires knowledge of the earth's interior. Seismology gives the most detailed characterizations of structure and composition.
Relative motions cause rocks to strain out of shape, generating elastic stress.
When the stress exceeds the strength of the fault zone, the accumulated strain will suddenly release in an earthquake. The sudden release of stored elastic potential energy during an earthquake releases both heat energy and seismic waves. The total energy is called the moment M0. By essentially taking the logarithm of the moment, we can create a magnitude rating. Every earthquake has a unique total energy, and therefore a unique magnitude.