As new seafloor is created at a spreading ridge, the rock "records" the orientation of Earth's magnetic field at the time the lava cools. As the rock moves away from the ridge it forms of series of stripes of alternating magnetic polarity (orange for "normal", white for reversed).
Images courtesy of the USGS.