Who wrote the gospels and what was the purpose?

In the Bible, there are four gospels recorded and commence in the New Testament. Although the authorship is not entirely evident, the writings are in accordance to Matthew, Mark, Luke and John. These authors spent time with Jesus and are likely...