The books of the Bible were formed gradually. They are the product of Jewish and Christian religious communities that was 95% illiterate. These stories were first word of mouth, then later put into writing. Moses did not write all the books of the Pentateuch. Paul did not write all the letters ascribed to him. Matthew and Luke partially rewrote Mark with other sources. There were additions and deletions, but we have what God wanted us to have.