Magnets
Magnets produce, either naturally or by treatment, a magnetic field. These objects have a north pole where the field exits the magnet and a south pole where the field enters the magnet. These objects are magnetized by either coming in contact with another magnet or with electrical current.
Magnetic Fields
Electrical currents also produce magnetic fields. These fields are present in electric wires and other objects that have a current running through them. This is how an electromagnet is created, and it can be recreated by wrapping a copper wire around a nail and connecting the two ends of the wire to the positive and negative ends of the battery, magnetizing the nail. The earth has a magnetic field because of electrical currents present in the atmosphere and the large amount of metal in the earth. The North Pole of the earth is actually the south pole of a magnet.
Compass
A compass uses a magnet to find the direction of the flow of the magnetic field. The needle of a compass is a magnet set on a balance so it can turn freely. The north pole of the compass magnet reacts with the magnetic field of the earth to point in the direction of the flow.
Declination
There is a difference in the actual geographic North Pole and the magnetic north pole on the earth. The magnetic north pole tends to shift. The difference between the magnetic north and true north is called declination. Most maps have a declination diagram showing the difference, in degrees, between true north and magnetic north for the area covered by that map.
Use
You can travel between two known points using a map and compass together. When transferring a compass reading to a map, be sure to take into consideration the declination between true north, on which the map is based, and magnetic north as measured by your compass. The declination diagram on the map gives you the number of degrees to add to or subtract from your compass reading to match the map, or the map reading to use on the compass.