Short answer
The Hadith are the reports of what the Prophet (ﷺ) said, did and approved. They explain the Qur'an and show how to live it. The Qur'an tells Muslims to pray, for example, and the Hadith show how he prayed. His companions memorised his words, and some wrote them down. The Prophet (ﷺ) told them to pass on what they heard. He warned that anyone who lied about him on purpose would take his seat in the Fire (Hell). Later scholars gathered the reports and checked the chain of narrators behind each one. Every narrator had to be honest and precise, and each link had to connect. The most authentic collections are those of two scholars, al-Bukhari and Muslim. Other collections, such as those of Abu Dawud and al-Tirmidhi, also hold many sound reports, each graded by scholars. Muslims learn how the Prophet (ﷺ) lived the Qur'an from the sound Hadith.
Full explanation
Why the Hadith matter
The Qur'an says the Prophet (ﷺ) was sent to explain clearly what was revealed. It says that whoever obeys him obeys God (﷾). It calls him the beautiful pattern for believers. So Muslims need to know what he said and did. The Qur'an commands prayer, but it does not describe every movement of it. The Prophet (ﷺ) told his companions to pray as they had seen him pray. The Hadith record what they saw. Alongside the Hadith, the Sira, the biography of the Prophet (ﷺ), records the events of his life in order.
“(We sent them) with Clear Signs and Books of dark prophecies; and We have sent down unto thee (also) the Message; that thou mayest explain clearly to men what is sent for them, and that they may give thought.”
“He who obeys the Messenger, obeys Allah: But if any turn away, We have not sent thee to watch over their (evil deeds).”
“Ye have indeed in the Messenger of Allah a beautiful pattern (of conduct) for any one whose hope is in Allah and the Final Day, and who engages much in the Praise of Allah.”
Malik ibn al-Huwayrith reports that he and other young men stayed with the Prophet (ﷺ) for twenty days. When he sent them home to teach their families, he told them: pray as you have seen me praying.
Memorised, written and passed on
The Prophet (ﷺ) told his companions to pass on what they heard from him, even a single verse. He told those present to convey it to those absent. He also warned that whoever lied about him on purpose would take his seat in the Fire (Hell). Most companions memorised. Some also wrote. Abdullah ibn Amr wrote down what he heard, and the Prophet (ﷺ) told him to keep writing. A man named Abu Shah, from Yemen, asked for a sermon in writing. The Prophet (ﷺ) said: write it for Abu Shah.
Abu Bakra reports that on the Day of Sacrifice the Prophet (ﷺ) asked the people what day, what month and what place it was, and then said: your blood, your property and your honour are sacred to one another, as sacred as this day of yours, in this month of yours, in this city of yours. He told those present to pass it on to those absent, since the absent might understand it better.
Abdullah ibn Amr reports that the Prophet (ﷺ) said: pass on what you have from me, even a single verse; you may relate the reports of the Children of Israel, and there is no harm in it; and whoever lies about me on purpose will take his seat in the Fire.
Abu Huraira reports that the Prophet (ﷺ) said, among other things: whoever tells a lie about me on purpose, let him take his seat in the Fire.
Abu Huraira says that no companion of the Prophet (ﷺ) narrated more hadith than he did, except Abdullah ibn Amr, because Abdullah used to write them down and he himself did not.
Abdullah ibn Amr says he used to write down everything he heard from the Prophet (ﷺ) in order to memorise it. Some of Quraysh told him to stop, since the Prophet was a man who spoke in anger and in contentment. When he told the Prophet, the Prophet pointed to his mouth and said: write, for by the One in whose hand is my soul, nothing but truth comes out of it.
Abu Huraira reports that after the conquest of Mecca the Prophet (ﷺ) gave a sermon. Abu Shah, a man from Yemen, asked for it to be written down for him, and the Prophet said: write it for Abu Shah.
The chain of narrators
Every hadith comes with its isnad (chain of narrators): who heard it from whom, back to the Prophet (ﷺ). At first people did not ask for chains of narration. After the civil strife of the first Islamic century, scholars began to demand these chains, saying "name your men". Ibn al-Mubarak, a scholar of the second Islamic century, said the chain is part of the religion. Without it, he said, anyone could say whatever he liked. A report is sound only if three things hold. Every narrator was upright (honest and of good character) and precise. Every link connects. And nothing in it is irregular (out of line with sounder reports) or defective (carrying a hidden flaw).
Muhammad ibn Sirin, a scholar of the generation after the companions, says that people used not to ask about chains of narration; but when the civil strife came, they said: name your men to us. The reports of trustworthy narrators were then accepted, and those of innovators were not.
Abdullah ibn al-Mubarak (d. 797 CE) says that the chain of narration is part of the religion, and that without it anyone could say whatever he wished.
The classical handbook of hadith criticism. It defines a sound (sahih) hadith as one whose chain is connected from beginning to end through narrators who are upright and precise, with no irregularity or hidden defect. It names al-Bukhari as the first to compile a book of sound hadith alone, followed by Muslim, and calls their two books the most authentic books after the Book of Allah.
A report of what the Prophet (ﷺ) said or did.
Who passed it on?
Every hadith comes with its chain of narrators, back to the Prophet (ﷺ).
Were they trustworthy?
Every narrator must be upright and precise.
Does every link connect?
Each narrator must have heard it from the one before him.
Is anything wrong with it?
Nothing in it may be out of line with sounder reports or carry a hidden flaw.
Then the report is sound (sahih).
The most authentic collections
Al-Bukhari (d. 870 CE) and Muslim (d. 875 CE) were two great scholars of hadith. Each set out to put in the main body of his book only reports that met the strictest standard. Muslim scholars call their two books the most authentic after the Qur'an. With the collections of Abu Dawud, al-Tirmidhi, al-Nasa'i and Ibn Majah, they make up the six best-known books. The four others hold many sound reports and some weaker ones, and scholars have graded each report. Muslim scholars accept a report from these four when it is graded sound (sahih) or good (hasan). They set aside the weak ones. This site quotes from these four only reports graded sahih.
The classical handbook of hadith criticism. It defines a sound (sahih) hadith as one whose chain is connected from beginning to end through narrators who are upright and precise, with no irregularity or hidden defect. It names al-Bukhari as the first to compile a book of sound hadith alone, followed by Muslim, and calls their two books the most authentic books after the Book of Allah.
Perspectives
The Islamic perspective
The Hadith record the words, deeds and approvals of the Prophet (ﷺ), which explain the Qur'an. They were memorised, written and passed on, then gathered by scholars who tested every chain. Al-Bukhari and Muslim hold first place.
The Qur'an gives the Prophet (ﷺ) the task of explaining what was revealed. It makes obeying him part of obeying God (﷾).
The Prophet (ﷺ) told his companions to pass on his words and warned against lying about him.
Some companions wrote hadith down in the Prophet's (ﷺ) lifetime, with his approval.
Muhammad ibn Sirin (d. 729 CE), a scholar of the generation after the Companions, records that after the civil strife, scholars began demanding named narrators. Ibn al-Mubarak called the chain part of the religion.
The collections of al-Bukhari and Muslim are the most authentic books after the Qur'an.