How did the books of the New Testament come to be in our Bibles?
The historic Christian belief is that the Holy Spirit, who controlled the writing of the individual books, also controlled their selection and collection. Very early on, some of the New Testament books were being recognized. Paul considered Luke’s writings to be as authoritative as the Old Testament. Peter recognized Paul’s writings as Scripture. Some of the books of the New Testament were being circulated among the churches. Clement of Rome mentioned at least eight New Testament books (A.D. 95). Ignatius of Antioch acknowledged about seven books (A.D. 115). Polycarp, a disciple of John the apostle, acknowledged 15 books (A.D. 108). Later, Irenaeus mentioned 21 books (A.D. 185). Hippolytus recognized 22 books (A.D. 170-235). You also have the Muratorian Canon (A.D. 170) with 24 books. (A reason why some of the earlier guys didn't have more books was because they didn't know of them, or perhaps knew of them, but didn't have access to them Times were hard under Roman persecution.)
It isn't like the Bible just popped into existence three centuries after Jesus died. The first disciples had known Jesus personally. They could tell the gospel story because that saw it first hand. They were eyewitnesses. They then told their followers and new believers these stories. There was a sort of oral tradition. They also didn't have long to wait before the New Testament was written. Most of the New Testament was written between A.D. 45 - A.D. 70. Only John writes after A.D. 70. Many of the books of the New Testament were being circulated among the churches well before A.D. 70. When each church got a copy of a book of the New Testament, they would make a copy of it. They also had ready access to the Old Testament. You can also recreate the entire New Testament except 11 verses, just from the writings of the Ante-Nicene Church Fathers. You make it sound like there was this long period of time where there was "no bible". Which is not correct. As I have stated, within 20-30 years after Jesus died the Churches had access to much of the New Testament. Until then, they relied on earlier written sources which Mark and Matthew used in the creation of their gospels, and oral tradition and the testimony of the eyewitnesses.
That's why Jesus promised they would remember what He had said to them.
"These things I have spoken to you while I am still with you. But the Helper, the Holy Spirit, whom the Father will send in my name, he will teach you all things and bring to your remembrance all that I have said to you."
(John 14:25-26 ESV)
What did they do with this that the Holy Spirit brought to their remembrance? They preached it, and the wrote it down for our benefit.
One thing must be emphatically stated. The New Testament did not become God's written Word because they were formally included in a canonical list. On the contrary, the Church included them in her Canon because she already regarded them as divinely inspired, recognizing their innate worth and generally apostolic authority, direct or indirect. The first councils to classify the canonical books were in 393 and 397. However, what these council's did was not impose something new upon the Christian communities, but to codify what was already the general practice of those communities. They verified and made official what the church has universally affirmed, that the sixty-six books in our Bibles are the only true Scripture inspired by God. The canon is complete.
It was God, and God alone, who determined which books belonged in the Bible. It was simply a matter of God’s imparting to His followers what He had already decided. The human process of collecting the books of the Bible was flawed, but God, in His sovereignty, and despite our ignorance and stubbornness, brought the early church to the recognition of the books He had inspired.
The Westminster Confession of Faith, written by the Puritans, contains a sufficient answer, worded far better then I ever could hope to word it.
"The authority of the Holy Scripture, for which it ought to be believed, and obeyed, depends not upon the testimony of any man, or Church; but wholly upon God (who is truth itself) the author of it: and therefore it is to be received, because it is the Word of God. We may be moved and induced by the testimony of the church to a high and reverent esteem for the Holy Scripture. The heavenly character of its content, the efficacy of its doctrine, the majesty of its style, the agreement of all its parts, the scope of the whole (which is to give all glory to God), the full disclosure it makes of the only way of man's salvation, its many other incomparable excellencies, and its entire perfection, are arguments by which it gives abundant evidence that it is the Word of God. Nevertheless, our full persuasion and assurance of its infallible truth and divine authority is from the inward work of the Holy Spirit bearing witness by and with the Word in our hearts." Westminster Confession of Faith Chapter 1 Sections 4 and 5.
Oh how I love your law! It is my meditation all the day. Your commandment makes me wiser than my enemies, for it is ever with me. I have more understanding than all my teachers, for your testimonies are my meditation. I understand more than the aged, for I keep your precepts. I hold back my feet from every evil way, in order to keep your word. I do not turn aside from your rules, for you have taught me. How sweet are your words to my taste, sweeter than honey to my mouth! Through your precepts I get understanding; therefore I hate every false way.
(Psalms 119:97-104 ESV)