When folks ask this question, they seem to be almost asking for something else other than that answer. It seems to more go on along the lines of, what are the human agencies and institutions that PRESERVED His Word? I mean, sure, many of us can simply say "Yahweh spoke it to Moses" - but how did all those who came after Moses get the Word to us, and how good a job did they do keeping it intact? This seems to be the real angst that folks want dealt with. Also, how do we know that either all the books in our canon should be there or, conversely, are there other books like 1 Enoch or Jubilees that should have been in but were wrongly excluded? How can we know? To answer this, I propose a series of steps:
(1) Understand that, at the most basic level, Father Yah spoke His Word to Moses to get the whole process started. Father Yah not only spoke that Word, He also set up the very institutions meant to preserve that Word as well as certify future installments of that Word coming to the children of Israel.
And Moses wrote all the words of Master Yah, and rose up early in the morning, and built an altar under the hill, and twelve pillars, according to the twelve tribes of Israel. (Exodus 24:4)
Deuteronomy 28:58-61: If you will not observe to do all the words of this Torah that are written in this book, that you may fear this glorious and fearful name, Master Yah your Mighty One; Then Master Yah will make your plagues wonderful, and the plagues of your seed, even great plagues, and of long continuance, and sore sicknesses, and of long continuance. Moreover he will bring upon you all the diseases of Egypt, which you were afraid of; and they shall cleave unto you. Also every sickness, and every plague, which is not written in the book of this Torah, will Master Yah bring upon you, until you are destroyed.
Deuteronomy 31:24-27: And it came to pass, when Moses had made an end of writing the words of this law in a book, until they were finished, that Moses commanded the Levites, which bore the ark of the covenant of Master Yah, saying, Take this book of the Torah, and put it in the side of the ark of the covenant of Master Yah your Mighty One, that it may be there for a witness against you. For I know your rebellion, and your stiff neck: behold, while I am yet alive with you this day, you have been rebellious against Master Yah; and how much more after my death?
(2) It is also important to understand that believing Moses wrote the first five books is not endorsing a rabbinic fairy tale; but rather, agreeing with Father Yah's Son and our Savior, Y'shua the Messiah:
Luke 24:44 And he said to them, "These are the words that I spoke with you while I was with you, that it was necessary that all things that were written in the Torah of Moshe and in the prophets and in the Psalms concerning me be fulfilled." (AENT)
John 1:45 And Peleepos found Nathaniel (Bar-Tulmay) and said to him, "He concerning whom Moshe wrote in Torah and the prophets, we have found him! He is that Y'shua, the son of Yosip of Nasrath." (AENT)
John 7:19 (Y'shua said,) Did not Moshe give you the Torah, yet not a man among you kept Torah! (AENT)
Other quotes and references to OT Scripture in the NT directly link the authorship of Genesis (Mark 12:26; John 7:22), Exodus (Mark 7:10; 12:24; Luke 20:27; John 6:32), Leviticus (Matthew 8:4; Mark 1:44; Luke 2:22; 5:14), Numbers (John 3:14; Acts 7:44; Hebrews 8:5; 9:4) and Deuteronomy (Matthew 19:7; 22:24; Acts 3:22), to none other than Moses as well!
(3) After Moses, Joshua himself first preserved the Torah for many years:
Joshua 1:8 This book of the Torah shall not depart out of your mouth; but you will meditate on it day and night, that you may observe to do according to all that is written in it: for then you will make your way prosperous, and then you will have good success.
Joshua 8:30-35: Then Joshua built an altar unto Master Yah, the Mighty One of Israel in Mount Ebal. As Moses the servant of Master Yah commanded the children of Israel, as it is written in the book of the Torah of Moses, an altar of whole stones, over which no man had wielded upon it any iron. And they offered on it burnt offerings unto Master Yah, and sacrificed peace offerings.
And he wrote there upon the stones a copy of the Torah of Moses, which he wrote in the presence of the children of Israel. And all Israel, and their elders, and officers, and their judges, stood on this side the ark and on that side before the priests the Levites, which bore the ark of the covenant of Master Yah, as well the stranger, as he that was born among them; half of them over against mount Gerizim, and half of them over against mount Ebal; as Moses the servant of Master Yah had commanded before, that they should bless the people of Israel.
Joshua 8:30-35: And afterward he read all the words of the Torah, the blessings and cursings, according to all that is written in the book of the Torah. There was not a word of all that Moses commanded, which Joshua did not read before all the congregation of Israel, with the women, and the little ones, and the strangers that were conversant among them.
Joshua 23:6 Therefore you be very courageous to keep and to do all that is written in the book of the Torah of Moses, that you do not turn aside from it, to either the right hand or to the left.
Then Joshua actually added to it:
Joshua 24:25-27: So Joshua made a covenant with the people that day, and set them a statute and an ordinance in Shechem. And Joshua wrote these words in the book of the Torah of Elohim, and took a great stone, and set it up there under an oak that was by the sanctuary of Master Yah. And Joshua said to all the people, Behold, this stone shall be a witness to us; for it has heard all the words of Master Yah which he spoke to us: it shall be therefore a witness to you, lest you deny your Mighty One.
(4) The Torah of Moses and Joshua was preserved throughout the period of the Judges, and the history from that three century long period would continue to be added to by anonymous priests and scribes. While we do not know who these men were, we do know who the final compiler of their word was: Samuel bar Elkanah.
1 Samuel 10:24-25: And Samuel said to all the people, See him whom Master Yah has chosen, that there is none like him among all the people? And all the people shouted, and said, Elohim save the king. Then Samuel told the people the manner of the kingdom, and wrote it in a book, and laid it up before Master Yah. And Samuel sent all the people away, every man to his house.
So like the books of Moses and Joshua, all that was known to Samuel was preserved and kept in or near the Ark of the Covenant and its attached shrine. Samuel will give us much of the material, not just of Judges but parts of David and Saul's life that he had witnessed prior to his death. This would have included other accounts from this period, such as the book of Ruth and perhaps the book of Job.
(5) Then, once the monarchy is set up, David and Solomon preserve the Scriptures they had and add to them Psalms, Proverbs, Ecclesiastes and the Song of Songs. That David and Solomon did this work of preserving His Word is also proven from the Scripture:
The words of Master Yah are pure words: as silver tried in a furnace of earth, purified seven times. You shall keep them, O Yah, You shall preserve them from this generation for ever. (Psalm 12:6-7)
You are my portion, O Master Yah, and I have said that I would keep Your Words. (Psalm 119:57)
From here all the kings of Judah and Israel are judged according to the standard of the Torah, all the way down to Josiah (2 Chronicles 35:26).
By this time individual prophets are also writing books that are preserved, both major (Isaiah, Jeremiah, Ezekiel) and minor (Amos, Jonah, Haggai, etc.)
(6) One of these major prophets, Jeremiah, is widely believed even in secular scholarly circles to be the final editor of 1-2 Kings.
Solomon's story dominates the first eleven chapters of Kings. The admirable Court History of David ends at 1 Kings 2:46. 1 Kings 3-2 Kings 25 is the work of a gifted and inspired compiler who gave the books their uniform theological outlook and highly stylized presentation of Israel's history. He probably lived at the close of Judah's history (ca. 590).
The emphasis on Elijah, Elisha, and other prophets, together with the editor's general prophetic outlook, has led many to attribute 1-2 Kings to Jeremiah. Indeed, the author did view Israel's history from a perspective akin to Jeremiah and wrote under many of the same influences.-William Sanford LaSor, Old Testament Survey (Eerdmans: 1982), p. 253.
Jeremiah's editing is apparent, for example, in the very truncated account he gives of his beloved King Josiah's death. Jeremiah makes it sound like Josiah did not provoke his battle with Egypt at all, while 2 Chronicles 35:20-25 gives a far different version.
Scholars today also believe that another final compiler - an unknown man only known as "The Chronicler" - could not have finalized 1-2 Chronicles much before 400 BCE (Old Testament Survey, p. 633). This editor, unlike Jeremiah, did not personally know any kings of either Israel or Judah, so he writes about them in a more unflinching and less idealized style. But both Jeremiah and the Chronicler are thought to have drawn from the same previous court records maintained by priests but simply edited them into different final forms.
Another important figure from this time was Hilkiah the High Priest, who may have also been the same Hilkiah who was Jeremiah's father, though we cannot be certain this is the case. Hilkiah found the book of the Torah in 622 BCE and presented it to Josiah which in turn prompted a series of great spiritual reforms in Judah.
This Book of the Torah was most likely hidden in the wall of the Temple to protect it from evil king Manasseh who was trying to turn the whole of Judah pagan. It was restored to Josiah and scrupulously maintained by the Hebrew people until the destruction of the Temple by Babylon in 586 BCE.
(7) After the Captivity, the Chief Priest of Babylon, a man named Ezra, had certainly preserved all the Scriptures written to that time and added to their story as well:
Nehemiah 8:1-2: And all the people gathered themselves together as one man into the street that was before the water gate; and they spoke unto Ezra the scribe to bring the book of the Torah of Moses, which Master Yah had commanded to Israel. And Ezra the priest brought the Torah before the congregation both of men and women, and all that could hear with understanding, upon the first day of the seventh month....
Nehemiah 8:5-8: And Ezra opened the book in the sight of all the people; (for he was above all the people) and when he opened it, all the people stood up: And Ezra blessed Master Yah, the great Mighty One. And all the people answered, Amen, Amen, with lifting up their hands: and they bowed their heads, and worshiped Master Yah with their faces to the ground. Also Yeshua, and Bani, and Sherebiah, Yamin, Akkub, Shabbethai, Hodiyah, Maaseiah, Kelita, Azariah, Yozabad, Hanan, Pelaiah, and the Levites, caused the people to understand the Torah: and the people stood in their place. So they read in the book in the Torah of Elohim distinctly, and gave the sense, and caused them to understand the reading.
To these the books of Ezra, Nehemiah, Esther and Daniel would be added, completing the OT or Tanakh "canon".
(8) However, starting in around 260 BCE, the process of translating the Hebrew Bible into other languages began with the Greek Septuagint and the Aramaic Peshitta Tanakh, along with many revisions by other scholars including the Samaritan Pentateuch and the Dead Sea Scrolls. Different traditions developed in different places, as some groups of Jews had additional books and others did not. The Rabbis in Israel would not deliver their final list of approved books until the end of the 1st century CE. This did not eliminate all dispute, though, about what should and should not be in canon.
What I can say is that for the books that ALL agree SHOULD be in the OT, these books have withstood every test that history can throw at them. They absolutely belong where they are!
For those who want to know if other books that were not included should be, that's a harder question to answer. As for me and my house, we will keep it CONSERVATIVE and believe the Ruach ha Kodesh spoke to ALL these early assemblies (Jewish, Christian and Nazarene-Messianic) to preserve these books of the Tanakh as we have them. The Rabbinic-Israel canon of 24 books (the same as the Christian 39 books) agrees with the books listed and/or quoted by Y'shua and his Apostles, and that's good enough for me.
Others may disagree saying the Jude quoted from Apocrypha and so on, but just because Jude used sources familiar to his audience before the final list was drawn up doesn't mean Jude himself thought this was Scripture. If we apply that logic, then we must also conclude that Paul was a pagan who wanted pagan poets that he quotes from (Epimenides, Menander, etc.) to be canonized as Scripture. Since I do not allow the latter, I need not concede the former.
My OT canon--consisting of the 24 (or 39) books we have, is the only structure that has proven superior to all attempts to discredit them. As for the rest, some are better than others, some are outright wrong, some are forgeries and none have withstood the trial by fire as the books that are in the OT canon now.
(9) As for the New Testament, that is much easier to talk about. The Gospels of Matthew, Mark, Luke and John preserve the actual words of Savior Y'shua, and their manuscripts and accounts have been with us from the very beginning. The NT in fact is the best ancient text that has ever been preserved in world history, in both Greek and Aramaic. The fact that its entire corpus is completed within 90 years of the events it records is without peer in the ancient world.
Therefore, if we throw out the NT as myth or unreliable, we must by the same process throw out every piece of literature ever recorded prior to the invention of the printing press. We can have a debate on whether Version A or Version B is best on a given line or if translation 1 is better than translation 2, but that is a side distraction to the overall facts about the NT as a whole.
I will say this: Don't tell me Rome replaced everything for its own ends. While Rome attempted to tamper with some things, the Eastern-Aramaic traditions escaped their greedy hands by being preserved in Persia, which was outside their influence. And the Greek actually also didn't fare as totally badly as some had feared either, because we can check it against the Aramaic to make sure.
In the end though, line by line and concept by concept, Father Yah has preserved the totality of His Word to mankind. We should never let questions about this line or this version of the text distract us from the big picture but let the mystery of understanding His Word drive us to appreciate it more and more for the Set-Apart revelation that it is.