Earth's Magnetic Poles
The earth has a magnetic force originating from both the north and south poles. Scientists believe this phenomenon results from flowing liquid in the earth's iron core. This constant movement creates a magnetic field that affects all other magnetized objects. Compasses utilize this magnetic force to spin and point towards true north.
True North and True South
True north and true south run close but slightly off the earth's poles. This slight deviation from the poles is referred to as declination. In fact, true north stands directly above Northern Canada. This results in an interesting problem for those using a compass above Northern Canada. A compass used here actually points in the complete opposite direction. While most people may not encounter this limited problem with the compass, most geographical maps make note of declination to aid the navigational process.
Rotating Pivot
The earth has a weak magnetic pull which explains the reason why magnetic objects around us tend not to react to this force. A compass compensates for the earth's weak magnetic field by placing a light compass needle at a nearly frictionless pivot point. This allows the magnetized ends of the needle to freely spin and react to the the earth's magnetic field.
Changes Over History
Navigators have used the concept of the frictionless pivot point for thousands of years. In fact, the first compass appeared in China a thousand years ago during the Song Dynasty. These early compasses used floating pieces of magnetized metal in small containers of water. The magnetized metal floats towards true north. It wasn't until the Age of Exploration, roughly 700 years ago, that the compass became widely used and took on its current form.