Leaving aside the actively-misleading irrelevance that is Bible scholarship (which almost-always has been based-on the secular assumption that Scripture is Not divinely inspired, nor divinely protected, nor sustained and transmitted with divine assistance... In other words, Bible 'scholarship' operates on the basis that Scripture is Not scripture)... Leaving that aside:
The Fourth Gospel is, uniquely, an eye-witness account of the life and teachings of Jesus - written by Jesus's most beloved friend and disciple; the first written and most important Gospel; written independently-from the other three 'synoptic' Gospels (none of which claim to be eye-witness accounts, and which were, from internal evidence, compiled and created some time after Jesus's death).
But when was the Fourth Gospel written? From internal evidence (with a qualification, which I will mention) it was written soon after the ascension of Jesus, while the events were still fresh and vivid in the mind of the author; accounting for the detailed and extremely convincing vignettes that jump-across the millennia into the mind of the reader...
The exception is the last chapter of the Gospel. The early-written Gospel finished at the end of Chapter 20 with the words: "30 And many other signs truly did Jesus in the presence of his disciples, which are not written in this book: 31 But
these are written, that ye might believe that Jesus is the Christ, the
Son of God; and that believing ye might have life through his name."
The words of the final verse (coming after the 'Doubting Thomas' episode) complete and summarise the message of, and reason for, this Gospel: all throughout. Who Jesus was, and what this means for each of us: what we need to do-about Jesus.
Chapter 21 was written later, after the death of Peter; and is mostly 'about' Peter, his relationship with Jesus; including and the mission Peter was given by Jesus. (That is, when Jesus once says feed my lambs, and twice repeats feed my sheep. (The meaning of this episode needs to be the subject of a separate post.)
Chapter 21 concludes with a reference to Jesus having correctly foretold the manner of Peter's death - signing-off with a reference to the Fourth Gospel author's apparent immortality, and a reassertion of his identity and eye-witness status.
Chapter 21 is therefore of the nature of an appendix to the main body of the Fourth Gospel - in terms of its discrete subject matter - and was presumably added some decades later than the bulk of the gospel.
Is this stuff important? Well, yes - because a late date for the whole Fourth Gospel has been a major source of error in understanding the New Testament; relegating what truly is the single most important (and the only essential) part of the Bible, to the status of a late commentary upon The Synoptics.
Knowing the early date and unique authoritativeness of the Fourth Gospel (which is really only a matter of taking Scripture seriously, in its own terms) transforms the way we read the rest of the New Testament; and indeed greatly clarifies the nature and meaning of Jesus.