A search of the internet finds many things true and untrue. One myth that is often propagated is that the New Testament came into being by agreement at the Council of Nicaea in 325AD. This is just wrong, which a small degree of research will testify to.
A more scholarly interpretation that is widely held is that the make up of the New Testament was put together and agreed upon late in the 2nd century. This is due to the extensive writings of Irenaeus around 180AD. Some even attribute the creation of the New Testament to Irenaeus (Bellinzoni, Luke in the Apostolic Fathers, 2005, p49).
However, an examination of earlier writings, such as Papias (~125 AD), the Epistle of Barnabas (~130), Polycarp (~110), and even as far back as the letters of Peter and Paul (~50’s) themselves, show that the early church considered various books of the New Testament, particularly the four Gospels, to be Holy Scripture from an early date (Kruger, The Question of Canon, 2013, p182-202). Papias, for instance, tells us that the Gospel of Matthew was the most popular in early Christianity, but authority as Holy Scripture was not simply a matter of popularity. Speaking of Matthew and Mark in particular, he says that their reliability “is guaranteed by authoritative remembrances” (Cameron, Sayings Traditions, 1984, p110). Papias is no doubt referring to “the Elder”, a disciple and eyewitness of Jesus, likely John, whom Papias knew and had heard.
Therefore, what gave these documents authority in the early church was the agreement and harmony with the eyewitness testimony of those who followed Jesus. Remember too, that we are not just talking about 12 eyewitnesses. Luke 10 tells us there were 70 other followers, and in Acts 1 we read of 120 disciples. This means the eyewitness testimony will have spread widely and been known widely, especially considering the enforced scattering of the disciples in Acts 8:1 because of persecution. Therefore, with a widespread distribution of the truth of Jesus’ teachings, if one or two disciples begin to change his teachings, this would become known and be rejected by the majority.
Indeed, we see this kind of widespread and public discussion happening throughout the first few hundred years over quite a number of books. Some books, such as Hebrews, made the cut and were accepted on the basis of agreement with the eyewitness testimony and the teaching of prior Scripture, rather than who the author was. Other books, such as the Shepherd of Hermas, while popular, were not considered to be the inspired Word of God, and were thus ultimately rejected. This process of public debate over the years gives transparency and weight to the development of the New Testament, and that it was neither controlled or imposed gives us confidence that it accurately reflects the teachings of Jesus without corruption.
If you want to delve into this subject at a deeper level, I would suggest getting a copy of Michael Kruger’s scholarly work ‘The Question of Canon’. (Click the link for a pdf copy of the introduction)