For example, in an electric motor, electric current produces a magnetic field which forces the motor to turn. Moving charged particles in atoms create a tiny electrical current, which produces a magnetic field. Thus atoms such as iron carry a magnetic field. The cause of the Earth's magnetic field is not well understood, but seems to be caused by electrical currents in the core. The magnetism of old rocks is called paleomagnetism .
Stars also have magnetic fields, probably caused by rotations of hot ionized gases in the star.
These magnetic fields cause spots on the Sun . Radiation is made from electric and magnetic fields.