Answer
If Scripture is to be our sole authority, on what authority do we know which books belong in the Bible - since the Bible does not state which books should be in the Bible? This is a very important question, because a chain is only as strong as its weakest link. In the chain of communication from God to humanity, is there a weak link? If so, then the whole chain fails, and the communication ultimately cannot be trusted.
Consider the various "links" comprising God’s communication to us: first came God’s desire to communicate. This was rooted in His love, for the most loving thing a good God can do is reveal Himself to His creation. Next came the actual transmission of God’s Word through human writers. This involved a process the Bible calls "inspiration," in which God breathed the words that the human agents recorded (2 Timothy 3:16). After that came dissemination, as the Word was delivered to its audience through preaching or other means. Then came recognition, as God’s people distinguished Holy Scripture from other religious writings. And then, preservation, through which God’s Word has survived to the present day, despite many attempts to destroy it. And finally, illumination, as the Holy Spirit opens the believer’s understanding to receive the Word.
And that’s the "chain"--the demonstration of God’s love in the inspiration, dissemination, recognition, preservation, and illumination of His Word. We believe that God was involved in each step of the process, for why would God go to such lengths to inspire His Word and then not preserve it? Why would He speak to us and then fail to guide us in recognizing His speech?
This recognition of God’s Word is usually called "canonization." We are careful to say that God determined the canon, and the church discovered the canon. The canon of Scripture was not created by the church; rather, the church discovered or recognized it. In other words, God’s Word was inspired and authoritative from its inception--it "stands firm in the heavens" (Psalm 119:89)--and the church simply recognized that fact and accepted it.
The criteria the church used for recognizing and collecting the Word of God are as follows:
1) Was the book written by a prophet of God?
2) Was the writer authenticated by miracles to confirm his message?
3) Does the book tell the truth about God, with no falsehood or contradiction?
4) Does the book evince a divine capacity to transform lives?
5) Was the book accepted as God’s Word by the people to whom it was first delivered?
Of these criteria, the one of most importance was the first one--was the book written by a prophet? Its corollary, "Did the book receive apostolic approval?", was the chief test of canonicity in the early church. This criterion is a logical result of knowing what an "apostle" was. The apostles were gifted by God to be the founders and leaders of the church, so it is reasonable to accept that through them came the Word governing the church.
The apostles were promised the Spirit of truth who would bring to their remembrance what Christ had said (John 14:26) and guide them into "all truth" (John 16:13). After the ascension of Christ, the apostles received supernatural gifts to enable their work and confirm their message (Acts 2:4). God’s household is "built on the foundation of the apostles and prophets" (Ephesians 2:20). Given the apostles' special commission, it only makes sense that the church made apostolicity the number-one test of canonicity. Thus, the Gospel of Matthew was considered canonical (it was written by an apostle); and the Gospel of Mark, with its close association with the Apostle Peter, was also accepted.
When the New Testament was being written, the individual books and letters were immediately accepted as God’s Word and circulated for the benefits of others. The church of Thessalonica received Paul’s word as the Word of God (1 Thessalonians 2:13). Paul’s epistles were circulating among the churches even during apostolic times (Colossians 4:16). Peter recognized Paul’s writings as inspired by God and equated them with "the rest of the Scriptures" (2 Peter 3:15-16). Paul quoted the Gospel of Luke and called it "Scripture" (1 Timothy 5:18). This widespread acceptance stands in stark contrast to the few debated books, eventually rejected as non-canonical, that enjoyed a limited favor for a time.
Later, as heresy increased and some within the church began clamoring for the acceptance of spurious religious writings, the church wisely held a council to officially confirm their acceptance of the 27 New Testament books. The criteria they used allowed them to objectively distinguish what God had given them from that of human origin. They concluded that they would stay with the books that were universally accepted. In so doing, they determined to continue in "the apostles' teaching" (Acts 2:42).