Hari Seldon first develops his mathematical idea of psychohistory and becomes the target of the Galactic Emperor because of it. The emperor thinks he could use this as a tool to gain better political control over his empire. In a process of intrigue Hari Seldon eventually flees to a remote sector of the Galaxy, trying to find out more about where civilization originated, in an attempt to develop psychohistory.
The whole Foundation Series is simply awesome. 7 books in total, they are all worth it. And all the rest of Asimov is worth it too.