There are at least three ways of approaching this question.
First a simple functional approach, driven by the likely intended audience of each book.
Secondly a text-critical approach which seeks to relate the three synoptic gospels as we have them to lost oral and written material such as ‘Q’, and so on.
Thirdly an exegetical approach such as the very famous, but still rather subjective, later Christian identifications of the four gospels with four themes, such as the Man, the Lion, the Calf, and the Eagle found in medieval illustrations. Or assigning medieval ‘humours’ or modern personality types to each gospel.
To keep things simple, we’re only here going to give the barest functional approach:
Matthew and Mark
One reason why Matthew and Mark exist, and why they are so similar, is related to the Jewish requirement for two eyewitnesses found in the Law of Moses:
A single witness shall not suffice against a person for any crime or for any wrong in connection with any offense that he has committed. Only on the evidence of two witnesses or of three witnesses shall a charge be established. (Deuteronomy 19:15 , ESV)
This rule was applied at the trial of Christ (Matthew 26:60), and is confirmed by Christ himself in dealing with gossip and offences against others (Matthew 18:16), as well as by Paul (1 Timothy 5:19). So clearly there could not be just one eyewitness testimony to an event as major as the resurrection.
Initially of course there were no shortage of eyewitnesses. Paul mentions that after the resurrection Jesus “appeared to more than five hundred brothers at one time, most of whom are still alive, though some have fallen asleep.” (I Corinthians 15:6). But clearly written eyewitness accounts were needed at an early stage, and as far as Jewish readers would be concerned that required at least two written Jewish eyewitness accounts. That doesn’t mean that Matthew and Mark were immediately brought forward in the shape they are now. And Luke 1:1 “many” suggests that there were other Jewish narratives which have fallen away. But at no time could there have been less than two.
The reason for Luke is the easiest of all the Gospels, as it is clearly stated in the first words:
1 Inasmuch as many have undertaken to compile a narrative of the things that have been accomplished among us, 2 just as those who from the beginning were eyewitnesses and ministers of the word have delivered them to us, 3 it seemed good to me also, having followed all things closely for some time past, to write an orderly account for you, most excellent Theophilus,4 that you may have certainty concerning the things you have been taught. (Luke 1:1-2, ESV)
So that is Luke, a Greek, writing for a Greek patron, and with other gospel accounts (presumably Jewish) available to him, and having supplemented his account with eyewitness interviews. A claim which is difficult to read as anything less than having interviewed Mary herself for his first chapters.
John is more of an issue, and a lot of attention is given to John 20:31 which concludes the gospel with a Luke-like authorial statement of purpose.
30 Now Jesus did many other signs in the presence of the disciples, which are not written in this book; 31 but these are written so that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name. (John 20:30-31, ESV)
The problem is that the Greek manuscripts have a small variance between PISTEUETE (continue to believe) and PISTEUSETE (come to believe)
πιστεύητε – “continue to believe”, present subjunctive : found in Sinaiticus and Vaticanus, and possibly P66 (Bodmer II), though the text here is lacunose (with a gap or lacuna) and not certain that there is room for the letter S or not.
πιστεύσητε – “come to believe”, aorist subjunctive : found in the majority of older but later manuscripts.
But the difference is perhaps not as large as often made out. Given that belief in the New Testament is not seen as a one time only decision but a process the additional Greek letter S in the less ancient but majority texts, does not mean that John is writing to convert non-believing Jews and Greeks to Christ. That would be an incredible conclusion given that every chapter of John addresses themes of the already convinced, and the same style in the prologue of 1 John 1, to the church, shows that the prologue of Gospel of John 1 is also written to the church. This is clearly not a ‘preaching gospel’ as Matthew, Mark and Luke are.
So that is a presentation of a simple functional answer to why there are four gospels: Two for Jews. One for Greeks. One for Christians.
Now given that most of the readers of all four gospels are Christians, people will naturally look for other reasons more applicable to those who are (no longer) Jews and Greeks, and its evident that despite their purpose to evangelise, preach, the three synoptic gospels do contain material that is designed for strengthening of belief in those who are already Christians.