The Theory of the Galactic Magnetic Field