The compass is an ancient instrument invented by the Chineese somewhere around 250 B.C., with all the relevant advances in compass technology refined, again by the Chineese, by the 15th century. The modern compass is nothing more than a magnetized needle floating freely in water. The needle is anchored by a pin in the center, allowing it to spin. The magnetized end of the needle is naturally affected by the Earth's magnetic field, causing the red end of the needle to point north. The needle does not point exactly toward the north pole, but rather to what is called "magnetic north"; a point near Ellsmere Island in Canada (82.7°N 114.4°W) and slowly moving toward Russia at a rate of about 35 miles per year.
What is a compass used for?
With a map:
Bearing: the direction you want to travel or the direction to a landmark.
Heading: The direction you are ACTUALLY traveling in. (Note, this is not necessarily the direction you WANT to travel in!)
True North: The direction to the North Pole.
Magnetic North: The direction the red needle points towards. Not the same as the north pole.