On the most important level the answer to this question is both simple and profound:
All Scripture is God-breathed and is useful for teaching, rebuking, correcting and training in righteousness. 2 Timothy 3:16 NIV
While this verse was originally referring to the Tanakh (OT Scriptures), it is also applicable to all the NT Scriptures. That is what the whole process of canonisation was about – determining which texts were undeniably God-breathed. That is why the other ancient texts that claim to be a gospel according to Thomas, or Judas, or Mary or whomever, were never included in the Bible – in their earliest years they were found to have false stories included in them and so were not accepted by the early church as having been God-breathed.
On the human level it is more difficult to determine conclusively who God used to write each of the four Gospels for us, despite the names attached to their titles. This is not a questioning of the authority or historic reliability of the Gospel accounts of Jesus’ life. In keeping with the practices of their Jewish culture, Jesus’ disciples took great care to memorise His teachings and deeds so as to pass these on faithfully to others and correct any misunderstandings. During their lifetimes these accounts were written down, meticulously copied and circulated to the groups of believers in every city, where they were read as part of the worship services. All the evidence supports the view that the four Gospels were based on high quality eye witness testimony with incredible accuracy of detail, and these have been reliably preserved for us. This is in stark contrast to the other “gospels” which were written later and rejected by the early church as lacking authenticity and accuracy, and can even now be shown to lack the historical details inherent in accurate accounts of Jewish life during the time of Christ. From a purely historical point of view we can have confidence in the accuracy of what we read about Jesus’ life and words in the four Gospels. Regardless of who the human authors of each of these four accounts are, they provide us with verifiable eye-witness testimony. (1) (2) (3) (4)
So, what does it matter who wrote each account of Jesus’ life? God used each author’s individual personality and life experience in His inspiration of the scriptures. With the Gospels, He used four different authors to give us four different perspectives. The more we learn about each author the more we can understand their perspective and the richer picture we get of those aspects of our Lord’s life and ministry. The scriptures are like a very detailed and multifaceted ancient treasure, the more different angles we view them from the more we see the richness of their beauty.
The original texts were written on scrolls without titles, verse/chapter numbers, or footnotes. As we saw when looking at the development of the Tanakh (OT), the Hebrew titles that have been added to the first 5 books of the Bible (“In the beginning”, “Names”, “And he called”, “In the desert” and “Words”) are totally different to the titles for these books which were added in our Bibles (which come from the Septuagint – first Greek translation), but the inspired scriptures are the same in both. It is not the titles that are inspired, but the text of the books. Unlike most of the other books in the New Testament, which included the author’s name in the text of the book (most often in the prologue), none of the authors of the four Gospel accounts penned their name in what they wrote. Each one chose to give an anonymous account of the life of Jesus. To them the important thing was not that they had been the one to write this account of the earthly life of Jesus but that the focus be on Jesus whose life they were recounting for us. (5)
With this apparent early anonymity there has been much conjecture among Biblical scholars as to who wrote each Gospel. The importance of this is that it affects the lens we view the Gospels through and how we understand the relationships portrayed in them.
We have two main sources of information that we can examine in attempting to determine who authored the gospel accounts of Jesus’ life: Church Tradition and the Scriptures.
1. Moreland, JP. Scaling the Secular City. s.l. : Baker and Baker Academic division of Baker Publishig Group, 2007.
2. Williams, Peter J. New Evidence the Gospels were Based on Eyewitness Accounts. Be Thinking. [Online] [Cited: 2019 Sept 2019.] https://www.bethinking.org/is-the-bible-reliable/new-evidence-the-gospels-were-based-on-eyewitness-accounts.
3. Knowing God. Why You Can Believe the Bible. Every Student. [Online] [Cited: 4th Sept 2019.] https://www.everystudent.com/features/bible.html.
4. Pitre, Brant. The Case fo Jesus: The biblical and Historical Evidence for Christ. New York : Crown Publishing, 2016. 9780770435486.
5. Ehrman, Bart. Why Are the Gospels Anonymous? The Bart Ehrman Blog. [Online] [Cited: 4th Sept 2019.] https://ehrmanblog.org/why-are-the-gospels-anonymous/.