Chain Of Hadeeth
Everyone did not have to remember the entire chain. Each person reported whom he heard something from and hadith scholars documented the chain.
If Imam Bukhari, met person X who says he heard it from Y. This person Y passed away already (for instance), how exactly we found out that Y heard it from J (passed away also) who heard it from K (passed away also).
Please refer to the video below from 37:21 to 43:07 https://youtu.be/CfBjgqrjdto?t=2241
I have already responded to this above.