My understanding of how the New Testament came to be is well described in "Zealot" by Azlan. The early church, over its first 400+ years of development created the scriptures to meet its own needs. So, for the first 400 or so years of Christianity there was no widely accepted Bible. There were only widely circulated writings from various leaders in the early church -- Gospels, letters, other writings. Early councils of the Catholic and Orthodox churches (Trent?? I can't remember) sorted through the most widely circulated writings and determined which they thought were best suited for use in the liturgy of the early church. They based their findings on many things including politics of the day, but stated that they looked for a connection to eyewitnesses to the events described, a general agreement with the accepted ideas about the church, and the leadership of the Holy Spirit.
When the Roman Catholic church became a world power, the Bible ceased to play a major role in Christianity for 1200 years or so. Only with the Protestant Reformation did the Bible again assume a strategic role in Christianity. Even then it was not extremely well known or well circulated until a couple of things developed -- first, the ability to print it in a cost-effective way, and second, a public well educated enough to at least read it if not understand it. When did those two things happen? In the US my guess is late 19th century, sometime after the Civil War -- give or take 50 years.
So, only in the last 150-200 years or so has the Bible played a major, perhaps even dominant, role in Christianity. Even now, the Bible really plays the major role only in evangelical Christianity. Evangelical Christians are still a small percentage of the worldwide church. And fundamentalist-leaning evangelicals may be a minority of evangelicals.
What happened before the last 150-200 years? Most people couldn't read, so they relied on the educated clergy both Protestant and Catholic to tell them what to believe about God and how to live their lives in relation to God. Even in the Great Awakenings of the US and Europe, the vast majority of people were illiterate and forced to rely on clergy. In the last 150 or so years things have drastically changed. People are more educated, but probably still not theologically trained well enough to begin to understand the Bible. My advanced degrees are in Theology and I am well aware how deficient my history, culture, and literature education is when it comes to being able to thoroughly understand the Bible.
In answering "How the Bible came to be" I'm also answering "how we can best use the Bible in our lives today" and "what part God played in that."
Today I use the Bible as a way of understanding how some people from hundreds (thousands) of years ago understood God, and how their ideas about God grew and evolved. It is a guide rather than a pronouncement. I take it all very seriously, but relatively little of it literally. How was God involved in its creation? God was involved in the lives of those people who for generations told these stories orally, then later wrote them down, then later collected them, edited them, and eventually printed and distributed these collections of stories, sermons, chronologies, songs, prayers, and struggles. How was God involved? Though those responsible for the creation and popularization of the Bible may have been quite spiritual and mystical, chances are good they're more like me and you. How was God involved in their lives? Probably the same as he is involved in your life and mine -- helping us muddle through some very real struggles and loving us all the while, helping us hope for the best for ourselves by doing our best for others.
Let me tell you about my friend Paul. He works for Cokesbury, or whatever the Methodist Publishing house is called these days. He is an editor. He spent five years working on a contemporary English version of the Bible that is extremely well done. How do I know Paul? Well, he makes bamboo fly rods as a hobby, plays golf, and lives a normal life. We have fished together and told each other horror stories about our churches. He's probably not all that different from one of those early council members who first determined which writings of the OT and today's new testament are canonical.