How does the core generate a magnetic field?
This is explained, in general terms, in the Introduction to Geomagnetism page given on this website. Briefly, then, as the result of radioactive heating and chemical differentiation, the outer core is in a state of turbulent convection. This sets up a process that is a bit like a naturally occurring electrical generator, where the convective kinetic energy is converted to electrical and magnetic energy. Basically, the motion of the electrically conducting iron in the presence of the Earth’s magnetic field induces electric currents. Those electric currents generate their own magnetic field, and, as the result of this internal feedback, the process is self-sustaining, so long as there is an energy source sufficient to maintain convection. The depiction of the geodynamo shown here is only schematic; in fact, the fluid motion and the form of the magnetic field inside the core are still the subject of intensive research.