The Earth's magnetic field is produced by a system of huge whirlwinds of molten metal in the outer core known as a "geodynamo". These vortices arise from a combination of two factors: convection, and the Coriolis force. Convection currents act as the basic pathways that the molten metals take, while the Coriolis effect causes the molten metal to spin and form into defined column-like structures, oriented on the same axis as the Earth's rotation. This process is called Dynamo Theory.
In view of the above Mars has only a solid core that prevents the development of a global magnetosphere. (no differentiation into outer and inner core).