What are the reasons why the hadiths were written down?
Question

What are the reasons why the hadiths were written down?
Praise be to Allah.Firstly:
The writing down of the hadiths refers, in general terms, to the narrator writing down his reports on paper. This was known from the time of the Prophet (blessings and peace of Allah be upon him).
The main reason for that was to document and protect the reports from being lost or forgotten.
This reason is so clear that there is no need for further discussion of proof.
One example of that is what was narrated by al-Bukhari (113) from Abu Hurayrah, who said: There is no one among the companions of the Prophet (blessings and peace of Allah be upon him) who narrated more from him than me, except ‘Abdullah ibn ‘Amr, who wrote down his hadiths and I did not.
At the time of the Sahabah and senior Tabi‘in, there were a number of people who wrote down some of their reports, but they did not pay attention to documenting the hadiths in a specific manner, compiling them in books as the Quran was compiled in one mushaf. There are a number of reports which indicate that they were not in favour of compiling the hadiths in a book.
There were two reasons for that:
-1-
They wanted to protect the Quran from being abandoned, or to avoid anything being written down at the time when the Sahabah were collecting the Quran in writing, lest the two things become mixed and confused.
-2-
At that time, the hadiths contained only the words and actions of the Prophet (blessings and peace of Allah be upon him) which explained the verses of the Quran. The isnads (chains of narration) were also brief and were hardly mentioned; they were not so lengthy that the Arabs would not be able to memorize them, for they were people who had excellent memories and were keen to maintain that skill by memorizing things. Moreover, the hadiths are not like the Quran, recitation of which is an act of worship; the hadiths are to be acted upon. As that is the case, there was no need for each of the Sahabah to know all the hadiths with their exact wording; rather it was sufficient for each of them to know some of the hadiths, then ask one another [about other hadiths] when necessary.
Shaykh ‘Abd ar-Rahman al-Mu‘allimi (may Allah have mercy on him) said:
In Islamic terms, what matters with regard to the hadiths is their meanings. They are not like the Quran, in which what matters is both the exact wording and the meaning, because it is the word of Allah in both wording and meaning, and is miraculous in both wording and meaning, and it is recited as an act of worship with its wording exactly as it was revealed. So it is no wonder that Allah reduced their burden and made it sufficient, in most cases, for some of the Sahabah to be aware of the hadiths and convey them."(Al-Anwar al-Kashifah, in Athar al-Mu‘allimi 12/43).
Some of them at that time would narrate hadiths and would seek out hadiths when necessary for practical reasons, so that they could act upon them, without going beyond that.
Shaykh ‘Abd ar-Rahman al-Mu‘allimi (may Allah have mercy on him) said:
… It was narrated from ‘Umar that he forbade narrating a lot of hadiths, and he did that for two reasons:
-1-
‘Umar’s preference was that narrating hadiths should only be done when needed.
-2-
What he stated clearly, which was that he preferred people not to be distracted from the Quran by listening to hadiths when there was no need to do so.
It was narrated from him that he said: “Narrate few hadiths from the Messenger of Allah (blessings and peace of Allah be upon him) and only narrate that which is needed to be acted upon.”
The reference to acting in this quotation is general in meaning, and includes acts of worship, interactions with others and etiquette."(Al-Anwar al-Kashifah, in Athar al-Mu‘allimi  12/61).
Dealing with the situation in that manner made it easy for them to memorize what they needed, therefore there was no urgent need to write the hadiths in a book. This is similar to the case of the Quran, which was revealed little by little, which made it easy for them to memorize it without needing to have the entire Quran in one book.
Al-Khatib al-Baghdadi (may Allah have mercy on him) said:
It has been proven that those who did not like to write down hadiths during the early period of Islam only disliked that so that no other book would be given the same importance as the Book of Allah, and the people would not be distracted from the Quran by anything else. Thus the Muslims were forbidden to acquire and read the previous Scriptures, because it is not possible to know what of their contents is true and what is false. Moreover, the Quran is sufficient and there is no need for the earlier Scriptures, because it supersedes them. And books of knowledge were prohibited during the earliest period, when Islam was very new, because there were so few people with proper knowledge at that time who could distinguish between revelation and other things. Most of the Bedouin had no understanding of religion and did not spend time with the scholars and knowledgeable people, so there was the possibility that they might confuse the books of hadith with the words of Allah in the Quran, and might believe that what was contained in the books of hadith was the words of Allah.
The people were instructed to memorize hadiths, because the isnads were short, as it was not long after the time of the Prophet (blessings and peace of Allah be upon him). They were forbidden to rely on books, because that would lead to a decline in memorization to the point that it would be almost non-existent, but if there was no writing down of hadiths, then people’s memories would become strong, for a person’s memory is with him wherever he goes."(Taqyid al-‘Ilm  p. 57).
Ibn ‘Abd al-Barr (may Allah have mercy on him) said:
Those scholars who disapproved of the writing down of hadiths disapproved for two reasons:
The first reason was so that there would be no book that was given the same importance as the Quran.
The second reason was so that the one who wrote down hadiths would not rely on what he had written and forego memorizing, in which case there would be fewer people who memorized hadiths."(Jami‘ Bayan al-‘Ilm wa Fadlihi  1/292).
Secondly:
Later on, especially in the second century AH, there emerged an urgent need to write down the hadiths in books, because the situation had changed. The hadiths had become widely circulated among people, because when the Tabi‘in realized that the number of Sahabah and senior Tabi‘in was declining due to their dying, they strove to seek out the hadiths that they had narrated, which they collected and kept in written form.
Al-Bukhari (99) narrated from ‘Umar ibn ‘Abd al-‘Aziz that he wrote to Abu Bakr ibn Hazm, saying: Seek out whatever hadiths of the Messenger of Allah (blessings and peace of Allah be upon him) are extant and write them down, for I am afraid that with the death of the scholars, knowledge will disappear.
Shaykh ‘Abd ar-Rahman al-Mu‘allimi (may Allah have mercy on him) said:
As a matter-of-fact, some of the senior Sahabah thought that conveying of hadiths was only to be done at a time of need, and they thought that if they conveyed hadiths to others when there was no need for that, there was the possibility of error for which they could be called to account, unlike when there was a need, in which case conveying what they knew of hadith was a must, and either Allah would protect them from error or a He would not bring them to account for it. Hence hadiths were narrated from all of them, and it was never narrated from any of them that he knew a hadith, but when there was a need to act according to its guidelines he refused to narrate it.
Some other Sahabah narrated hadiths even when there was no need for that, because they thought that conveying them before the need arose was something good, as the Prophet (blessings and peace of Allah be upon him) said: “Narrate from me, and there is nothing wrong with it.” And there is other evidence which speaks of conveying knowledge and conveying hadiths.
Each of the two views has a point, and the scholars were all aiming to do good.
But when the number of Sahabah became few, the view of the second group carried more weight."(Al-Anwar al-Kashifah, in Athar al-Mu‘allimi 12/61).
This is like the case of the Quran at the time of the Prophet (blessings and peace of Allah be upon him): there was no urgent need to put it all together in a written book, but as the reciters among the Sahabah who had memorized it began to die one after another, there emerged the need to compile it all in one master copy.
It was narrated from ‘Ubayd ibn as-Sabbaq that Zayd ibn Thabit (may Allah be pleased with him) said: Abu Bakr sent for me when the people of Yamamah had been killed (i.e., a number of the Prophet's Companions who fought against Musaylimah). (I went to him) and found 'Umar bin al-Khattab sitting with him. Abu Bakr (may Allah be pleased with him) said (to me):‘ ‘Umar has come to me and said: Casualties were heavy among the reciters of the Quran (i.e. those who knew the Quran by heart) at the Battle of Yamamah, and I am afraid that more heavy casualties may take place among the reciters on other battlefields, whereby a large part of the Quran may be lost. Therefore I suggest that you [Abu Bakr] should issue orders that the Quran be collected.” Narrated by al-Bukhari (4986).
And there are many similar reports, because the hadiths had begun to include the fatwas and verdicts of the Sahabah, then the views and fatwas of the Tabi‘in.
‘Abd ar-Razzaq narrated in al-Musannaf (11/258) from Ma‘mar that Salih ibn Kaysan said: I met Ibn Shihab when we were both seeking knowledge, and we agreed to write down some hadiths and other reports. So we wrote down everything that was narrated from the Prophet (blessings and peace of Allah be upon him), then we wrote down what was narrated from his companions. I said: No, it is not part of the Sunnah. But he said: Yes, it is part of the Sunnah. So he wrote it down and I did not; he did well and I missed out.
Then the isnads (chains of narration) became lengthy and numerous, because the number of narrators increased.
In addition to that, many views of innovators began to spread among the people, and views based on personal opinion and fabrications of hadiths and reports also became widespread.
All of this prompted the leading scholars of hadith and Sunnah to compile what they had collected of hadiths in specialized books, so as to preserve the Sunnah and spread it among people.
Al-Khatib al-Baghdadi (may Allah have mercy on him) said:
Scholars only began to write down knowledge and rely on writing down hadiths in books, after having been reluctant to do that, because hadiths and reports had become widespread; isnads had become longer; the names, kunyahs and lineages of narrators had become numerous; and technical terms varied, and people were unable to memorize all of that…"(Taqyid al-‘Ilm  p. 64).
Al-Hafiz Ibn Hajar (may Allah have mercy on him) said:
You should understand, may Allah increase me and you in knowledge, that the reports of the Prophet (blessings and peace of Allah be upon him) were not written down in books at the time of his Companions and the senior Tabi‘in, and they were not sorted into categories, for two reasons:
The first reason was because, in the beginning, they were forbidden to do that, as is proven in Sahih Muslim, because of the fear that some of that might become mixed with the Quran.
The second reason was because they had the ability to memorise things and their minds were clear, and because most of them did not know how to read and write.
Then towards the end of the time of the Tabi‘in, the writing down of hadiths and reports began, and similar hadiths and reports were grouped together in different categories, when the scholars scattered throughout different regions, and a lot of innovations appeared on the part of the Kharijis, Rafidis and those who denied the divine decree (Qadaris).
The first ones to compile the reports in books were ar-Rabi‘ ibn Subayh and Sa‘id ibn Abi ‘Urubah…"(Hadi as-Sari p. 6).
This has to do with general reasons, but there may have been specific reasons too. The author of each book may have had a specific motive, on the basis of which he chose to put hadiths in certain categories. For example, it is well known that al-Bukhari divided his book al-Jami‘ as-Sahih [Sahih al-Bukhari] into various categories for certain reasons.
Al-Hafiz Ibn Hajar (may Allah have mercy on him) said:
Abu ‘Abdillah Muhammad ibn Isma‘il al-Bukhari said: We were with Ishaq ibn Rahawayh and he said: Why do you not write a brief book in which you record the sound hadiths of the Messenger of Allah (blessings and peace of Allah be upon him)?
He said: I liked that idea, so I began to compile the book of al-Jami‘ as-Sahih [Sahih al-Bukhari] …"(Hadi as-Sari  7).
Abu Musa al-Madini narrated in Khasa’is Musnad al-Imam Ahmad (p. 14):
It was narrated that ‘Abdullah ibn Ahmad ibn Hanbal said: I said to my father (may Allah have mercy on him): Why did you not like people to write books, then you did al-Musnad?
He said: I wrote this book to be a reference book, so that if people differed concerning the hadiths of the Messenger of Allah (blessings and peace of Allah be upon him), they can refer to it. End quote.
And Allah knows best.