Isaac Asimov started creating his Foundation stories in the early 1940s and his last Foundation novel was published in the early 1990s. By the time that Asimov was done with his last novel in the series, Forward the Foundation, he had linked the Foundation to his other stories about robots and, in particular, the telepathic robot Daneel Olivaw. The Foundation saga described a future in which people from Earth had spread to 25,000,000 planets across the galaxy and all those colonized worlds were united within a single Galactic Empire.
The Galactic Empire was stable, facing no serious internal or external threats to its continued existence. Even when the Empire did finally begin to crumble, few could imagine that such a long-lived institution might collapse. One of the first people to anticipate the destruction of the Empire was Hari Seldon, a mathematician. Seldon devised a new mathematical science, Psychohistory, which could help humanity safely avoid most of the death and destruction which otherwise would occur after the fall of the Empire.
Following the dictates of Psychohistory, Seldon established two small "Foundations". The First Foundation was placed at the fringe of the galaxy and its small team of encyclopedists was tasked with creating the Encyclopedia Galactica, a compendium of human knowledge. The Encyclopedia Galactica would assure that humanity's cultural heritage not be lost when the Empire collapsed.
The Second Foundation was entirely secret and it remained hidden on the old capital planet of the fallen Empire. The Second Foundationers had telepathic abilities. The Empire disintegrated and most of the galaxy declined into barbarism; for example, losing the technical know-how needed to continue using microfusion power sources and instead having to fall back on primitive energy sources such as fossil fuels. The First Foundation never lost its technological and scientific heritage and became the political and economic nucleus of a newly expanding network of Foundation worlds.
What is probably the most interesting twist in the Foundation stories came in Foundation and Earth. Asimov revealed that R. Daneel Olivaw had created the Foundations, but his true plan for protecting humanity's future was to establish Galaxia, a vast group mind within which individual humans would be telepathically linked and integrated. Asimov thus showed us his last point on the Foundation timeline, a point where Galaxia, not the Foundations, had been identified as constituting humanity's future. Asimov depicted the Foundations as a kind of backup plan, developed by Daneel Olivaw in case Galaxia did not work out.
It has been suggested that Asimov could not find a good way to continue on with more stories that would come after Foundation and Earth. The Start of Eternity is a sequel to Asimov's time travel novel, The End of Eternity, but it also provides an ending for the Foundation Series. The central character in The Start of Eternity is the very first positronic robot who had a human-like mind, R. Gohrlay.
Given the way in which Asimov left the Foundation at the end of Foundation and Earth, apparently superseded by Galaxia, we might conclude that the Foundation was a just a BIG MISTAKE, similar to Eternity. That possibility, and others, are explored in The Start of Eternity.