First, a short timeline of the pertinent Jewish history:
2448 - Kabbalas HaTorah (1313 BCE)
2488 - Death of Moshe, Jews enter Eretz Yisroel
2516 - Death of Yehoshua
2533 - Osniel ben Kenaz becomes Shofet
2884 - Dovid HaMelech becomes king
2924 - Shlomo HaMelech becomes king
2964 - Shlomo HaMelech dies, nation is divided - Rechavam becomes king of Yehuda; Yeravam ben Nevat becomes king of Yisroel
3187 - 3205 - Ten Tribes are exiled
3213- Sancheirev invades Yehuda
3338 - First Bais HaMIkdash is destroyed
3390 - Zerubavel leads return to Eretz Yisroel
3408 - Purim is made into a Yom Tov by Modechai
3412 - Secomd Baid HaMIkdash is completed
3413 - Ezra leads return to Eretz Yisroel
3515 - Targum Shivim is made
3623 - Chanukah declared a Yom Tov
3839 - Second Bais HaMIkdash is destroyed (70 CE)
Now let us see whether it is reaosnable to assume the Torah was written by a human author in ancient times.
1) Q: Is it possible the Torah was written within the last 2,000 years?
A: Certainly not. Philo and Josephus wrote their history books 2000 years ago, in which they recorded all the events of Tanach as accepted history. They even named the books of Tanach. In Contra Apion, Josephus writes:
For we have not an innumerable multitude of books among us, disagreeing from and contradicting one another, as the Greeks have, but only twenty-four books, which contain the records of all things past; which are justly believed to be Divine; and of them five belong to Moses, which contain his laws and the traditions of the origin of mankind till his death. (Book 1, Chapter 1, Number 8)
Q: Did Josephus consider the Torah of recent vintage?
A: No. Josephus was speaking of something that was already considered very old in his time. At the beginning of Contra Apion, Josephus writes as a matter of history that the sacred books are very old, and he asserts that no one has ever added to them or changed them in all the years since they were created. Philo, too, writes that the books of the Torah are very old.
Note that the books of Josephus and Philo were written in Greek and were in the hands of the gentiles - not the Jews - for 2,000 years.
The writings of Josephus and Philo both prove thatthe Written Torah was already composed by the first century of the Common Era.
Exile to Babylon
These two prominent public figures, Philo and Josephus both wrote about the exile of the Jewish people to Babylon and the return to Eretz Yisroel therefrom of part of the nation to build the Bayis Sheini. It would make no sense that these historians concocted these events, as these were incidents that the entire Jewish nation experienced a mere 500 years ago (in their time) and were universally known. The nation would have quickly contradicted such fabrications had they been made up. Also, the Jews in Eretz Yisroel then spoke Aramaic, which they learned in Bavel. Josephus also describes very large Jewish communities in Babylon in his days, which he says matter-of-factly that came there from Eretz Yisroel after the destruction of the first Bais HamIkdash. Josephus knew that had he made up that story, entire communities in Bavel would have been collectively contradicting him.
So we can assume the historicity of the Babylonian conquered of Judea and the exile of its inhabitants to Bavel. There was also, at that time, a Jewish daughter-colony in Eretz Yisroel that which returned there from Bavel.
Did the Jews in Bavel have the Torah?
Definitely. Besides the Tanach itself in numerous places stating that the Torah was in Bavel (Ezra 6:18, 7:10,12,21, Nechemiah 8:1,3,8,18, 9:3, 13:1. See also Yehoshua 8:31,34, 23:6, 24:26, Melachim 2 14:6), there is Ben Sira, the Books of Macabees, and Targum Shivim to corroborate this as well.
The Targum Shivim is a Greek translation of the Torah first written by rabbis and later changed dozens of times by numerous people. It is claimed by the Gentiles to date back to 275B.C.E. So the Written Torah already existed at thattime.
The Book of Ben Sira (who lived in the early days of the Second Bais HaMikdash.) also mentions the Books of Torah, with the same number and the same names that we have today.
The Book of Ben Sira (who lived in the early days of the Second Bais HaMikdash.) also mentions the Books of Torah, with the same number and the same names that we have today.
The two Books of Macabees documents the Torah as well.
Now at the time Josephus wrote his history, the return from Bavel was of more recent vintage than the discovery of America by Columbus is today. It was clearly historically accepted that the Jews returned from Bavel together with the Torah.
Besides our own Mesorah, Philo, Josephus, the Targum Shivim, the book of Macabees, and Ben Sira have been in gentile hands for 2000 years and more.
The Shomronim
In addition to all this, the Samaritans accepted the Chamisha Chumshei Torah and Sefer Yehoshua. They obvisouly got these Seforim from the Jews. But when?
The Shomronim were vicious enemies of the Jews from the beginning days of the second Bais HaMikdash. There was no way they would accept any Torah from the Jews from then on, and so it is clear that the Samaritans must have gotten their Torah books from the Jews before the beginning of the Bayis Sheini.
We are now about 400 years before Philo and Josephus, where both Jews and Samaritans both possessed the 5 Books of Moshe and Sefer Yehoshua. Important to note is that the Samaritans did NOT accept the other books of the Tanach. This also shows at what point in time the Samaritans accepted their "Torah."
The Samaritans were brought from Kusa by Shalmanesser to settle in the land of the Ten Tribes. These tribes had broken away from Judah right after the reign of Shlomo HaMelech, when the books written by Shmuel haNavi (Shoftim, Shmuel, Rus) were still new, and the long established books were Chumash and Yehoshua.
After the breaking off of the Ten Tribes, the tribes would never accepts any Torah from the Jews of Yehuda. They rebelled against Dovid's kingship, and so they would not accept Dovid's Tehillim, Shlomo HaMelech's books, or the books written by the prophets of those kings, Shmuel, Gad, and Nosson (Shoftim and Shmuel). The rest of Tanach was composed in Yehuda after the split of the Ten Tribes.
But after the Tem Tribes were exiled by Shlmanesser, a number of them remained in the land (Melachim 2 [23:20], Divrei Hayamim 2:[34:9]), and they were the ones who taught the newly-settled Samaritans the religion of the Jews (Malachim 2, 17). They gave them the Chumash and Sefer Yehoshua. This took place somewhere around 550 BCE. So, by then the Chumash and Yehoshua were already written.
This also proves that the Torah could not havebeen written during the time of the split of the Yehuda and Yisroel. Since the Ten Tribes taught the Chumash and Yehoshua to the Samaritans, that means the Ten Tribes had to have had these Seforim before they split off from the other two Tribes. After they split, neither kingdom would never have taken any Torah from the other.
The Tanach itself verifies that the Ten Tribes had the Chumash, because it describes many of their behaviors that are direct fulfillments of Torah laws. Tp cite but one of numerous examples, they expelled lepers form the city (Malachim 1 (7:3), as opposed to neighboring peoples who did not expel lepers (Malachim 2 5-1:5). The Torah is mentioned by the Neviim of the Ten Tribes themselves as something that was commonly known (Hoshea 4:6, 8:1, 8:12, Amos 2:4).
We now know that the Torah was written before the break-off of the Ten Tribes. But it would also make no sense that the Torah was new at that time. Because if that were so, the Ten Tribes would not have taken it with them, just as they did not take Shmuel's books. Yeravam ben Nevat would surely not have taken any Torah composed during the days of Dovid or Shlomo.
Now the events of Kabbalas HaTorah and Yetzias Mitzrayim, which involved the entire nation of Klall Yisroel happened a mere 480 years before Shlomo HaMelech built the Bais HamIkdash. Dovid HaMelech became king 40 years before that. Now the Kuzari argument becomes so much stronger. The national events described in the Torah were being taught to the descendants of that nation a mere four centuries after they transpired.
Does it make sense that someone could have made up those stories about the ancestors of the entire nation? That took place a mere four centuries ago?
But we are not done. The Torah prohibits us from waging war against Amon and Moav. It would be a major stretch of the imagination to say that that Dovid wrote this law himself, considering that he and Shaul HaMelech did in fact wage war against these nations; and considering that Amon invaded Eretz Yisroel in the days of Yiftach and Moab invaded in the days of Ehud, would it make any sense that in those days there was a prohibition written against waging war with these bitter enemies of ours?
Ehud was the Shofet after Osniel ben Kenaz, who was a younger contemporary of Yehoshua ben Nun!
...Which puts the Chumash and Sefer Yehoshua exactly in the time period they belong!
(Taken mostly from the writings of Rav Avigdor Miller ZTL)