How earthquakes are made