Some of the best parts of the bible r when Jesus was alone speaking to god but somehow it would appear that someone was writing it down.
The general style of writing accounts in those days was that someone would put together a "collected sayings" document, in this case, "sayings of Jesus", which would be things attributed to the person by tradition (not necessarily by contemporaries). It was not journalistically sound in the modern sense.
More embellished accounts would be written around these, hence, the gospels.
Textual criticism generally arrives at the view that 3 of the 4 gospels (Matthew, Mark and Luke) are derived from / based upon the same now-lost document, generally referred to as "Q", which was in modern terms a "collected alleged sayings of Jesus".
There are variants on this theory (see for example [en.wikipedia.org], but it has been the basic underpinning of Biblical scholarship for the past 120 years or so.