Lava cools and hardens to form new rock at mid-ocean ridges. Magnetized crystals in new rock "record" the direction of Earth's magnetic field when the lava cools. Over time, more new rock forms and older rock moves away from the ridge. The rock stores a record of magnetic reversals as a series of "normal" (orange) and reversed magnetism (white) stripes.
Images courtesy of the USGS.