In all compasses, there is a magnet that feels the pull of the strong magnetic force of the North Pole. The earth is filled with an iron core which also creates a magnetic pull; thus, the iron core is like a huge magnetic bar, stretching from the South to the North Pole. The iron in the middle of the earth is extremely hot, so the iron turns into a solid. With the heat from the core, and the earth rotating, the iron, of course, rotates with the earth. As the liquid iron is moving around and around, this liquid iron forms into the bar magnet around the axis of the earth. Hence the the North Pole has this magnetic force.
Interestingly, there is also a force known as the Magnetic North, located in Canada, and this is actually to what compasses point. (the second "North Pole.") This spot, discovered in 1831, moves about 10 miles northwest every year, so it has moved many miles since its discovery.