Other contributors have said "What causes Earth's magnetic feild?" is the same question as "What causes the Earth's magnetic field?" If you believe that these are not asking the same thing and should be answered differently, click here
The Earth's magnetic field is generated by a self-sustaining dynamo effect caused by the fluid motions of the conductive liquid metal in the iron-nickel outer core.
The earth's magnetic field is mainly due to electric currents flowing in the magma, and roughly parallel to the equator. There is not necessarily only one current path, what we see is the net effect....
As you might already know, a magnet is the most powerful at it's ends. So what the inner core of the Earth's magnetic field does is that it surround the Earth.Thank you.