Tradition says that the gospels now known as Matthew, Mark, Luke and John were actually written by the persons whose names the gospels now bear. Of these, Matthew is thought to have been a tax collector and therefore literate, Luke was a physician and therefore literate. We know too little reliable information about Mark to say if he was literate, while it would be quite surprising if John could write.
However, in spite of tradition, the four New Testament gospels were all written anonymously and were only attributed to Matthew, Mark, Luke and John at various times during the second century. Ian Wilson says in Jesus: The Evidence, page 25, despite the versions printed in our Bibles long having borne the names Matthew, Mark, Luke and John, these names are mere attributions. In the fourth century, Eusebius says that Papias (c. 130 CE) named Mark as the author of one gospel and the ‘interpreter’ of Peter, presumably as if Mark had written from Peter’s memory and notes as his secretary (Eusebius, Ecclesiastical History, 3.39). Burton L. Mack says in Who Wrote the New Testament, page 205, that exactly when the name of John came to be associated with the gospel and letters of John is most unclear, but the earliest attestation that these were regarded as having been written by John is found in Irenaeus’ Against Heresies, dated about 180 CE.
John Dominic Crossan says in The Birth of Christianity, page 100, a vast majority of scholars in this century considers that Mark was used by Matthew and Luke as a major source. We could perhaps argue that Luke might have used Mark as a source, although this would remove any grounds for believing that 'Luke' was the physician companion of Paul, but it stretches credibility to say that Matthew, a disciple of Jesus, would need to rely on another gospel. This confirms that we simply do not know who wrote the gospels.
The author of Mark, the first gospel to be written, was far from a simple person in spite of the apparent, and possibly intentional, use of poor grammar. His use of Greek rhetorical devices such as intercalation ('sandwiches'), chiastic structures and parallel structure surely mark him as one of the most gifted writers of the first century. David Rhoads, Joanna Dewey and Donald Michie say in Mark as Story (third ed) page 1, the composer of this story has used sophisticated storytelling techniques, developed the characters and the conflicts, and built suspense with deliberateness, telling the story to generate certain insights and responses in the audience.
Once we accept that the second-century Church Fathers, with the best intentions, gave incorrect authorship attributions to the New Testament gospels, it ceases to be a mystery as to how the authors might have been literate.