The earth's magnetic field changes over time and this causes changes in the direction of magnetization of magnetic elements or minerals in rocks.
Our magnetic field is widely believed to originate from activities within the outer core where molten iron and nickel moves. The flow of these molten elements results in the production of the magnetic signatures on earth surface.
Some elements and minerals within rocks are capable of recording the direction of magnetic fields at a period in time. Before magma cools, such minerals in these rocks aligns their poles to that of the prevailing direction of the earths magnetic field. This is how the magnetic changes at the mid-oceanic ridges are recorded.
An earthquake is the result of a sudden release of stored energy in the Earth's crust that creates seismic waves. Earthquakes may occur naturally or as a result of human activities. Smaller earthquakes can also be caused by volcanic activity, landslides, mine blasts, and nuclear experiments.