The Seldon Plan refers to the plan engineered by Hari Seldon, Yugo Amaryl, Wanda Seldon, and others at the Psychohistorical Project to shorten a projected thirty thousand years of chaos and war following the inevitable collapse of the Galactic Empire to a mere thousand years, leading to the establishment of a Second Empire -- one whose survival and prosperity is assured by psychohistory.
Psychohistory is a scientific theory created by Hari Seldon that can be used to predict the actions of human beings in large social groups. The Psychohistorical Project was created by Emperor Cleon in Prelude to Foundation in hopes of preventing the Empire from falling -- but Seldon knew this was impossible. He and others realized that it was possible to use psychohistory to predict the effects of changes made to the political fabric of the Empire. Using psychohistorical prediction, Seldon and others fashioned a Plan. The particulars of the Plan are never delved into outside of Foundation, but we do know that the plan involves the two Foundations. The First Foundation is the bastion of physical science and political order while the Second Foundation is a covert group of people hidden away who are experts in mentalics and psychohistorical prediction. While not much detail about the Plan is ever given, Asimov makes clear the fact that Seldon anticipated every development of the Foundation up until the arrival of The Mule.
Although the Seldon Plan cannot anticipate mutants like the Mule, the Second Foundation exists to keep the Plan on track. Even it, however, cannot compete with the master mentalics of Gaia.
Ultimately, the Plan was flawed due to its assumption that only humans could play a significant role, although this was possibly tackled in the Hyper-Plan mentioned in Foundation's Edge.