Short answer
Some hadith are fabricated, and Muslim scholars said so openly 1,200 years ago. That is why they built a science to separate the authentic from the weak and the false, and Muslims accept only what meets its standards.
The fuller answer
The science of hadith asks: who narrated it, did each narrator meet the one before, were they honest, did they have a good memory, and does the report contradict the Quran or better-established reports? Scholars wrote biographical dictionaries on tens of thousands of narrators to answer this. Reports that fail the test are labelled weak or fabricated and are not used as proof.
Bukhari reportedly selected about 7,000 reports out of some 600,000 he examined. Modern historians debate how early the chains were recorded, and Muslim scholars reply with early written collections. Muslims agree that the hadith must be graded, and the grade of every hadith in this website's library is shown.
This answer follows the mainstream Sunni understanding and is general learning, not a fatwa. Where Muslims differ, the answer says so. Have a question of your own? Write to us.