One thing is for certain, it didn't drop out of the sky.
Christianity without the Bible is hard to imagine. But in fact, for the first 300 years of the Church, the Bible (meaning a single compilation containing all of the texts sacred to Christianity) didn’t exist.
The creation of the Bible was a long process. Leaders of the early Church sifted through numerous manuscripts and discerned, under the guidance of the Holy Spirit, which books to keep and which books to set aside.
The process of establishing a canon of Scripture differed for the Old and New Testament.
Formation of the Old Testament
The Old Testament is basically an ancient compilation of the Jewish Sacred Scriptures. These holy texts developed over time and were at first handed on orally from one generation to the next until they were finally written down and preserved.
About 200 years before the birth of Jesus there arose a Greek translation of the Hebrew texts that became widely accepted as a legitimate (even inspired) translation. Tradition relates how King Ptolemy II of Egypt ordered a translation and invited Jewish elders from Jerusalem to prepare the Greek text. Seventy-two elders, six from each of the 12 tribes, arrived in Egypt to fulfill the request.
Another tradition recounts how the translators were all put in separate rooms and told to produce their own separate text. When the task was completed the translators compared them all and it was discovered that each one was miraculously identical to the others.
The result became known as the Septuagint (from the Greek word for 70) and was especially popular among Greek-speaking Jews. This led to the Septuagint becoming a primary source for the Gospel writers and many other early Christians.
When formulating the official canon of Scripture the Church looked to the Septuagint to discern which books to retain. The Catholic canon of the Old Testament also includes some texts and additions to books (for example, the Books of Judith and Tobit, Wisdom and Sirach) originally written in Greek, not Hebrew, and therefore not considered part of the Jewish Scriptures,though respected and read by Jews.
Formation of the New Testament
Inspired by the Holy Spirit, various writers wrote down in the years following Jesus’ death the many stories circulating about the Messiah. These writers were either apostles, or friends of apostles who knew Jesus very well. They witnessed the events or interviewed people who had, and sought to preserve the authentic life of Jesus Christ and his many teachings.
As time progressed copies of these works were spread and various Christian communities gathered them to be read during the Sunday celebration of the Mass. Copies of St. Paul’s letters were also disseminated and were regarded by the communities as inspired by the Holy Spirit.
Already by the time of Saint Irenaeus (A.D. 182-88) there is mention of the “quadriform” Gospel, referring to the four Gospels of Matthew, Mark, Luke and John.
During the fourth century the need arose to officially codify the Bible, which by this point was already starting to come together. Some historians believe that part of the motivation to produce an official canon came from Emperor Constantine who commissioned 50 copies of the sacred scriptures for the Bishop of Constantinople.
The approval of which books to include started with the Council of Laodicea in 363, was continued when Pope Damasus I commissioned St. Jerome to translate the Scriptures into Latin in 382, and was settled definitely during the Synods of Hippo (393) and Carthage (397).
The goal was to dismiss all erroneous works that were circulating at the time and instruct the local Churches as to which books could be read at Mass.
The Church has always believed that this lengthy process was guided by the Holy Spirit. As the Catechism explains, “Holy Mother Church, relying on the faith of the apostolic age, accepts as sacred and canonical the books of the Old and the New Testaments, whole and entire, with all their parts, on the grounds that, written under the inspiration of the Holy Spirit, they have God as their author, and have been handed on as such to the Church herself.”