It just takes stuff from wikipedia, and maybe a bit of chat from players, in its responses. As far as I know at least.
There are two versions of Fact Sphere, let's take a look at both:
The first, which I like to call just "Fact Sphere" is just a simple bot with a script that has an array of phrases and a schedule event to go through each one, once it get's to the end it repeats it's self, I've seen the source code for Fact Sphere so I know how it works.
And the second, which I call "Fact Sphere 2.0" is much more complex. I'm surprised someone but that amount of effort into creating a bot like this. Fact Sphere 2.0 takes quotes from the chat and looks them up on the Internet. Most people assume it is from Wikipedia, which Is probably true since Wikipedia isn't too hard to take info from. Once Fact Sphere 2.0 finds the right page from a quote it will then say some information about it in the chat. Example: If I said "Chicken" in the chat, Fact Sphere 2.0 would then look up information about Chicken and display it in the chat.