After the Buddha passed away, his teachings were preserved without any alteration or without any loss by means of three great councils.
The Buddha didn’t speak from books that he had written and he didn’t write anything down. Instead people came and asked him questions and voiced their doubts and their uncertainties. The Buddha would answer these questions, so that the teaching of the Buddha were actually answers to various people’s questions and doubts. These questions would become the opportunity for expounding the truth, for speaking of the true nature of everything.
We may ask, “Well, if everything was just said by the Buddha and nothing was written down, how come things didn’t get lost or altered or modified as time went on?” The reason this did not happen was that many of those who were receiving the Buddha’s teaching were monks totally dedicated to the path of the Buddha.
When they listened to the teaching, they did it with all their heart and immediately put the teachings into practice so they realized the fruition of the path extremely quickly, allowing all the qualities of intelligence to rapidly blossom in them. Among other things, they achieved the power of perfect memory which means each word the Buddha said was engraved very deeply in their memory so that every word was kept in their minds and nothing was lost.
After the Buddha's passing away, one of the his most important monks named Mahakashyapa gathered Five Hundred Arhats for a great council to keep all the teachings intact. The meeting took place in the great Banyan cave, which was on the bank of a hot springs close to the Vulture Peak near Rajagriha. It was presided over by three Arhats in particular: Ananda, Mahakashyapa, and Upali. They recited every word of the Buddha that they had heard and each of these three expounded on particular aspect of the teaching of the Buddha.
So Upali expounded the Vinaya teachings (those on monastic discipline), Ananda the Sutras (the oral teachings), and Mahakashyapa the Abhidharma (teachings on the mind and other advanced subjects). They would begin by saying, “Thus have I heard" or "This is how the Buddha spoke.” Each of these three Arhats would recite everything they had heard. In this way, they established very clearly and formally what the Buddha’s teachings were, so that from that point onwards all the teachings were classified into these three groups.
The purpose of this First Council was to make sure that all the immaculate words of the Buddha would be preserved in their purity and wouldn’t be lost. For instance, if even one part of a sutra had been lost, then the whole teaching of the Buddha would have lost some of its meaning. That is why they wanted to keep everything intact.
But, of course, it is possible that some of us will have doubts about this. We may feel that since there were no books to record the teachings of the Buddha, then maybe the sutras are not complete or maybe some of them have been made up by his followers. However, we do not need to entertain these kinds of doubt because the Arhats were very great beings who respected the Buddha’s teaching so deeply; they wanted to keep the teachings very pure, as they had been delivered originally by the Buddha.