Going back to the OP question, it makes a lot more sense if you understand the historical context.
You're asking the question as if some one person heard Jesus talk in A.D. 30, then wrote about it 30 years later. But that's not how it worked. There was a massive movement of followers who were hanging on his every word from the beginning. Even the things that were initially said only to his closest disciples, those disciples would have been spreading those messages all over the place to all of their followers in the church within a couple years of first being told it. They lived in an oral era, hearing things as they were told and then repeating them to others was there M.O.
By the years 60-70, when the synoptic gospels were written, the original hearers of the words would have been getting up in age but most of them were still alive....and by then they would have told their stories THOUSANDS of times to hundreds of thousands of listeners. Many people would have heard the same stories, the same sermons, dozens and dozens of times by then.
When the book of Mark was written in A.D. 60, it would have been immediately rejected by the people of the Church if it contradicted what they already knew about what Jesus had said. It wasn't like it was new information to them, it was the stories they already knew well, the stories the church formed around. That was just when they decided to put it into writing as a single narrative before all the original witnesses had passed away.
And the fact that we have three different comprehensive accounts written within 20-40 years of the events, for an incident in the 1st century, is MUCH more contemporary than virtually anything else written about anyone in that time outside of emperors. Look at the major Jewish rabbis of the same era - many of the accounts of their words weren't written down systematically until much later than that. It's difficult to find another historical figure with as much contemporary writing about him as for Jesus.
p.s. - But also going back to O.P., I think it's perfectly reasonable to suggest that the dialogue isn't necessarily "word for word, no mistakes". What they would have is the essence of what Jesus said, the message, regardless of whether the exact wording was perfect. I do think, though, that the things where Jesus wanted them to get perfect, he probably repeated to them a lot of times.