Answer: the Holy Spirit.
If I delay, you may know how one ought to behave in the household of God, which is the church of the living God, a pillar and buttress of the truth.
1 Tim. 3:15 (ESV)
The dependence of the church on the Word is not a doctrine readily acceptable to all. In former days of Roman Catholic polemic, for example, its champions would insist that ‘the church wrote the Bible’ and therefore has authority over it. Still today one sometimes hears this rather simplistic argument. Now it is true, of course, that both Testaments were written within the context of the believing community, and that the substance of the New Testament in God’s providence … was to some extent determined by the needs of the local Christian congregations.In consequence, the Bible can neither be detached from the milieu in which it originated, nor be understood in isolation from it.
Nevertheless, as Protestants have always emphasized, it is misleading to the point of inaccuracy to say that ‘the church wrote the Bible’; the truth is almost the opposite, namely that’God’s Word created the church’. For the people of God may be said to have come into existence when his Word came to Abraham, calling him and making a covenant with him. Similarly, it was through the apostolic preaching of God’s Word in the power of the Holy Spirit on the Day of Pentecost that the people of God became the Spirit-filled body of Christ.
John Stott, Authentic Christianity (Downers Grove, IL: InterVarsity Press, 1995), 303.