How does one measure what causes earthquakes?
There are a number of causes (this list is probably not complete):


Elastic Rebound of tectonic faults. This is the most common and well known. Here the energy is elastic energy stored as two blocks of rocks move against each other. There is a point where elastic deformation cannot take up the entire movement, and the rock breaks releasing the elastic energy. This is better explained here: Reid's Elastic Rebound Theory (USGS)
Landslides/etc. These typically appear as extremely shallow earthquakes and can often be determined from seismic records.
Cavity collapses. E.g. mines, volcanic systems, caves.
Subterranean explosions / volume expansion. Eg. mining activity, atom bomb tests, volcanic activity (eg. phreatic involving water; or magma injection)
Crystalline phase changes. Fast, deep subduction zones (eg. Tonga) experience very deep earthquakes where the rocks should be too plastic for classic elastic rebound. These are usually interpreted as 'catastrophic' phase changes of olivine -> spinel -> perovskite, and the depths generally match. Eg. Kirby 1991.