Magnets have north and south poles that exert magnetic forces, attracting opposite poles and repelling like poles. Magnets create magnetic fields that can either attract or repel other magnets or iron entering the field. The Earth has its own magnetic field created by its molten iron core, which causes compasses to align with the magnetic north pole that is offset from true geographic north by around 9 degrees.