Luck. And precession. The Earth behaves like a spinning top which, like gyroscopes, seem a little magical at first. Actually they are governed by very simple and reasonable physical laws, only we are not very familiar with rotating objects.
Things are very easy to move on ice, because there is little friction. However, if you are on a skating ring and a car slides out of control towards you, you would not be able to stop it safely with your bare hands. This is because a heavy fast-moving car has a lot of linear momentum, and great forces will be needed to reduce it. This is why the Titanic hit the iceberg: you can rotate a big boat, but it will take a long time to change the direction of the linear momentum (the direction of movement)*.
*In fact, if you try to steer your boat too fast, it will break before it changes its direction.
In a similar way, objects without rotation are easy to turn and move around, but if they are spinning fast then they feel heavy against rotation. (If you have not played with a gyroscope yet, please do, you will love it.)
So it is not that physical laws are weird, but the fact that very few objects can rotate fast in our natural experience. The force of gravity makes a spinning top change its rotation axis (instead of just falling like a non-spinning top would). With the rotating Earth and the gravitational pull from the Moon and Sun a similar thing happens, and the celestial rotation axis rotates with a very long period of about 26000 years.
This means that Polaris has not always been the North Star. It was not so in the Middle Ages and the days when the Romans ruled Europe. And during the heyday of Ancient Egypt the North Star was Thuban, a not-so-bright star in Draco. In a few centuries Polaris will yield its North Star status for a long time to come.
People are not so lucky in the Southern Hemisphere, with no bright stars close to the celestial South Pole. Good news is they will have plenty of South Stars starting some 2000 years in the future and for around 10000 years before entering the dark half of their cycle once again. A matter of patience. And a compass, do not forget your compass.