Various people in Sunnydale seem to be the beneficaries of the 'Hellmouth Genius' effect. That the Hellmouth makes them smarter and allows them to do things that elude conventional science for centuries. These include Willow, Daryle Epps, Warren and Ted's creator.