Firstly, the idea that Moses wrote the Pentateuch comes originally from Jewish tradition, which was later adopted by Christian scholars. Whilst it is claimed in the Pentateuch that Moses wrote sections of it, nowhere does it claim that Moses wrote all of it. Throughout the NT the books are often referred to as the "law of Moses" but this is simply due to the aforementioned tradition, and in reality no one actually knows who wrote them.
Secondly, the majority of scholars today accept some variant of the Documentary Hypothesis, or otherwise still consider several of the books to be written by different authors writing at different times.
The Documentary Hypothesis "proposes that the Pentateuch was derived from originally independent, parallel and complete narratives, which were subsequently combined into the current form by a series of redactors". More information on the Documentary Hypothesis can be found here.
Why couldn't Moses have written all of it?
Part of the problem lies in the fact that at no point in the Pentateuch is it stipulated that Moses is the author; certain portions are said to be by Moses, but not the total writing. On the other hand, there is good evidence that Moses could not have been the author. In Gen. 14:14, Abram is said to have led a group of men to the city of Dan, but elsewhere it is stated that this city did not come into existence until the time of the Judges (Judg. 18:29), long after Moses' time. The conquest by the Gileadites of the area called Havvothjair took place in the time of the Judges (Judg. 10:3-4), yet it is reported in the Pentateuch (Num. 32:41; Dent. 3:14). The time of the Hebrew monarchy is reflected in Gen. 36:31, yet this passage is set in a discussion of the patriarchal period. How could Moses write of conditions that did not come into being until long after his death?The rest of this article can be found here.
Historicity of Moses
Thirdly, it is by no means certain that Moses actually existed. From wikipedia:
"The existence of Moses as well as the veracity of the Exodus story are disputed among archaeologists and Egyptologists, with experts in the field of biblical criticism citing logical inconsistencies, new archaeological evidence, historical evidence, and related origin myths in Canaanite culture"One such origin myth is the Legend of Sargon. Sargon, also known as Sargon the Great, was an Akkadian Emperor who reigned from c. 2334-2279 BCE. The Legend of Sargon is a Sumerian text which relates the story of Sargon's birth and childhood.
Here is a short excerpt:
My lowly mother conceived me, in secret she brought me forth.You can find the full text here.
She placed me in a basket of reeds, she closed my entrance with bitumen,
She cast me upon the rivers which did not overflow me.
The river carried me, it brought me to Akki, the irrigator.
Akki, the irrigator, in the goodness of his heart lifted me out,
Akki, the irrigator, as his own son brought me up;
The similarity with the story of Moses' birth is clear.
This in itself does not mean that Moses did not exist, only that the writer supposedly used an existing literary motif to introduce Moses as a ruler. However, many leading archaeologists and biblical scholars today cast doubt on the entire story of the slavery of the Israelites in Egypt, and the subsequent exodus. Some are sceptical that the events occurred at all, while others suspect that there is perhaps a small thread of historical truth behind the story, but that the story is mostly literary embellishment.