According to the USGS, an earthquake happens due to sudden movements of tectonic plates along fault lines that separate them.