These paragraphs at the beginning of each chapter are called epigraphs. In Foundation and subsequent novels in the same series are, as you correctly pointed out, extracts of the fictional Encyclopedia Galactica, whose name is inspired on the real world Encyclopedia Britannica and is meant to be one of the main sources of collected knowledge in that fictional universe.
Anyway, the Encyclopedia Galactica is just a narrative device, it does not exist as a complete work, and the extracts that you can find at the beginning of each chapter serve only narrative purposes, in example:
- they provide background information to the reader, without being closely tied to the point of view of the characters, and create expectations by vaguely addressing what will be the main plot of the chapter;
- they serve as world-building devices: by including fictional scholarly works the author can give his narrative authenticity and provide sense of wonder on a large scale, which is one the main staples of the whole space opera sub-genre;
- by including these quotes, the author can also accompany his work with some "out-of-universe"-like commentary and tell you "pay attention to these things, which have a heavy historical significance" without breaking the immersion, in fact reinforcing it.
As Daniel Roseman said in his comment, Asimov was not the only author to use this literary device, which is frankly quite common: Frank Herbert's Dune is another example in the sci-fi genre, or even Umberto Eco's The Name of the Rose if we consider literature in a more general sense (even if in that case the paragraphs were not extracts from another text in a strict sense).