Traditionally, the first few books of the Old Testament, or the Torah, were written by Moses (though that’s unlikely to be true since biblical scholars believe them to have been written years and years apart from one another.) different books have different authors, sometimes they reflect the name of the book, and other times it’s told to us in the first few chapters of the book who who each one. Also, the bible as we know it was only canonized during the roman period. It’s likely that these were individual books (in the New Testament anyway) they made their way through many different circles of Christian groups, and we’re compiled because of each of their popularity. That’s why we see other gospels that were not canonized- the popularity and message of the texts were crucial to their canonization.
Another note- the Old Testament was solely the holy book for Jews until the coming of Jesus. And some of the books in the New Testament weren’t finished being written until almost 90 years after his death. Hope that answers some of your questions! Lol. I find this stuff pretty interesting so I ended up on a tangent. Haha