How does the earth's core create a magnetic field?
There are charges moving inside the core and according to the Biot Savart Law, a magnetic field will be produced.
Very simply. Magnetic field is created by electric currents. The currents are simply charges that are rotating inside the earth. This convection, which is in the plane of rotation of the earth, generates a magnetic field which points to the north. Now why does the core move: because it's hot. Why is it hot: because of friction as material sinks deeper, because of radio-activity inside the core.