The challenges of the second century, including local persecution of Christians and the growth of heresy (Gnosticism, Marcion, and the Montanists), were not responded to by the establishment of a biblical canon in the second century, but rather by setting forth a “canon of faith” (regula fidei), namely, a creed that stated what was generally believed to be the true teaching of the church at that time. There was no firmly fixed biblical canon at the end of the second century, but rather several books of the NT—primarily the Gospels and several of Paul’s Letters—were beginning to be called “Scripture.”
Lee Martin McDonald. The Biblical Canon: Its Origin, Transmission and Authority, p. xix.
McDonald raises an interesting point, one which bears elaboration and extension into the first century. Rather than characterizing the regula fidei as a “creed” particularly, which calls to mind a classic verbal summary formulation of beliefs, like the Apostle’s Creed or the Nicene-Constantinopolitan Creed, among others, it’s better to understand the regula fidei as a shared worldview, which includes not only particularized statements of beliefs, but is truly an entire complicated mindset involving behavior, action, belief, vocabulary, and writings, just as it still is today. The regula fidei that I know as an Eastern Christian is more than the Nicene-Constantinopolitan Creed we recite in the Divine Liturgy, much, much more. But I digress.
McDonald mentions a series of instances in which the Church was forced to clarify its beliefs in the face of disbelief or wrong belief. Eventually, these clarifications would take the form of Ecumenical Councils, which would respond to various heresies and administrative issues. But earlier, before such a universally organized and effective response was possible, what was the practice? McDonald mentions here the formation of the regula fidei in the second century in response to such stimuli. I would say that we quite literally need to date the establishment of this back into the first century itself, finding the writings of the apostles and their successors reflecting an earlier establishment of the regula fidei that was operative at that time, the original apostolic deposit of faith, not so well-articulated as in later years, once it had gained interest, so to speak, yet obviously present. In this sense, the actual writing of the Gospels and Epistles and other books fits also into that framework of stabilization later represented by the Ecumenical (and other) Councils, following as the writings do on the verbal, personal establishment of the faith communities, the local churches, by the apostles. Notice that in every one of the New Testament writings we find clarification on various topics in the form of correction or even polemic which is sometimes so mild as to be missable and other times sharply, almost viciously, explicit. In this sense, the writings themselves are an expression of clarification of that regula fidei established by the apostles in their missionary work, and preserved among the communities thus founded. This is particularly clear in the letters of Paul, where in several letters we find him misunderstood (I think primarily of the two letters to the Thessalonians) and so clarifying issues, or explicitly reacting against improper beliefs imposed by others (seemingly every other letter of his!). The Gospels too, contain more subtle evidence of such, as well, if only by their existence and acceptance among the apostolically founded groups that they were believed to represent Christ more truly, indeed, to reflect more clearly the regula fidei than other gospels did.
So, I would like to suggest that the writing of the individual New Testament books, their preservation, and subsequent canonization as part of the New Testament was all a part of the growth of the deposit of faith, part of the safeguarding of the original apostolic regula fidei. During the second and third centuries, the work of safeguarding the faith continued differently, by producing other, different writings, and also thereby extending defense of the faith more fully. Eventually, the first expressions of defense and establishment of the faith, those books we know as the 27 books of the New Testament, being related to the apostles themselves and the first generation of Christians, were recognized as authentic and particularly more foundational and special than subsequent orthodox writings, and were established as a canon. The recognition of these books in particular was also somewhat circular. As there was an original deposit of faith at the establishment of the various churches of the Great Church, as it was then known, and these works were shared among those apostolically founded communities, the worldview or the regula fidei in the communities and the writings meshed, and each reinforced the other. The esoteric expansive writings of the New Testament apocrypha didn’t stand a chance outside their own communities, as they literally made no sense in the context of a different regula fidei. On the other hand, various other writings, like the Shepherd of Hermas, the Letters of Ignatius of Antioch, etc, and popular expansive writings like the Acts of Paul, written also from within the same apostolically founded regula fidei, were very popular, but recognized as sub-apostolic, and not as valuable as those earliest documents.
In summary, the writing of the New Testament documents occurred for the reason of defense of the faith, as the further clarification of the very rule of faith (regula fidei) established by the apostles when the local church communities were founded in the first century.
(As a side note, I use two terms in the above: “esoteric expansive writings” and “popular expansive writings.” I am putting these terms through a trial run, to test them for applicability as replacements for “apocrypha” and “pseudepigrapha” in relation to both the Old and New Testaments. That is, all such materials tend to be expansive literature based on some element or other of the core canon of the OT or NT. The “esoteric expansive writings” show clear sectarian markers that indicate their use in only a particular group. The “popular expansive writings” were those works which were, of course, popular, more well-known, and thereby better preserved. Using “esoteric” and “popular” seemed good choices to avoid the arguments which would ensue by using “heretical” or “gnostic” versus “orthodox,” which would be anachronistic or incorrect. The popular works are occasionally of questionable orthodoxy, and “gnostic” wasn’t the only kind of non-orthodoxy around. In any case, new terminology to replace “apocrypha” and “pseudepigrapha” is necessary, and these are my suggestions.)