The Catholic answer to that question would be that because the decisions of the Catholic Church on faith and morals (and faith and morals ONLY) are protected by the Holy Spirit, we have the guarantee of God that a mistake could not have been made, since the compilation of the Bible would be a matter of faith. Only the Catholic and Orthodox Churches have that protection. Without it, there is no way to guarantee the process. It is one of the primary reasons I’m a Catholic.
Suppose you can’t trust their judgment. By that logic, the Docetists or the Gnostics could have been right all along! Maybe the compilers made a mistake! Really, the only other alternative is to completely trust the judgment of those that compiled the Bible, and hope that they studied the problem thoroughly, always remembering that they are flawed human beings. If you do that though, can you really guarantee that those books are inspired?
Would you rather trust men, or men protected by the Holy Spirit?