It's basic photographic optics really - changing the spacing of a compound lens changes the focal length.
One early anastigmat, the Steinheil Unofocal (the name isn't as dreadful in German as it is in English), originally consisted of four airspaced lens elements where all four elements had exactly the same focal length, except that two of them were negative. Without spacing the focal length would have been infinity!
That's also how zoom lenses work, except that there are a few more elements to keep the mount-to-focal-plane distance (more or less) constant.