As the New Testament was being written...how were the books selected for the canon?
This is an interesting and important question. Especially as we head into the "specials on Jesus and the Bible season" on Discovery, History Channel and the like. Good TV...but often bad or at least, less than truthful, history.
Well, this is a big topic, but here are the three primary criteria that were used to distinguish between which writings would or wouldn't become Bible.
1) Apostolicity – it was written by an Apostle or an associate of an Apostle (cf. Mark with Peter)
2) Orthodoxy – it conforms to the teachings / theology of the Apostles. (BTW Constantine had nothing to do with the selection of the biblical books. He convened the council of Nicaea in 325 - but that dealt with relationship of Jesus the son to the father).
3) Catholicity (or Universality) – accepted by churches throughout the region.
As Wallace et al conclude in their excellent book, Reinventing Jesus, “Eventually, three kinds of literature were decisively rejected as non-canonical: (1) those that were obvious forgeries (2) those that were late productions (2nd century or later) and (3) those that did not Conform to the orthodoxy of the core books already known to be authentic.”(149)
Regarding (2), NT scholar Darrell Bock reminds us “Orthodoxy is not the product of third-century theologians. Those theologians certainly developed and honed traditional teaching. They gave flesh to the bones and structure to the basic ideas. However, the core of ideas they worked with and reflected in their confessions can be found in the faith’s earliest works. These works embraced what the apostles passed on. The works that we find in the New Testament also testify to this faith. That is why they were recognized as special sources for this teaching, even seen as being inspired by God."(The Missing Gospels, p.213)
Conclusion. This wasn't a power play and this process was well thought out--though it took time. Remember this is in an Oral culture before the Printing press is invented. We know that 21 of the 27 NT writings were functioning authoritatively by 180 AD and the 4 Gospels and the major letters of Paul were in place around AD 130.