With all due respect to the scholars and textual critics, who conclude Moses cannot have written the Pentateuch, there are clues to the authorship within both the writings themselves and later writers which deserve to be brought to attention, as these are the BASIS of the tradition which holds Moses as the author, and which can be actually interpreted without resort to the advanced theories of scholars removed by several millennia from the time when the books were written.
The Pentateuch itself asserts Mosaic authorship.
Exodus 17:14 – Then the Lord said to Moses, “Write this for a memorial in the book and recount it in the hearing of Joshua…" [also Ex 34:27]
The Lord was convinced He was addressing Himself to Moses, or else the author has written pure fantasy.
Exodus 24:4,7 – And Moses wrote all the words of the Lord. … Then he took the Book of the Covenant and read in the hearing of the people. And they said, “All that the Lord has said we will do, and be obedient.”
Moses is stated to have written the book of the Law by the author of the book. So either the author was lying, or, as the people then understood well, the book was in fact the word of the Lord, and ought to be obeyed, regardless of who gave it to them. This general attitude toward the Law was the same in later writers who spoke of Moses and the Law. It wasn't really Moses that mattered at all to them, but the God who gave His word to them through Moses. This is called the doctrine of inspiration, and corresponds exactly to the traditional view of Mosaic "authorship". [Deuteronomy 21:34 attests in similar fashion that Moses wrote that book.]
Exodus 31:18 – And when He had made an end of speaking with him on Mount Sinai, He gave Moses two tablets of the Testimony, tablets of stone, written with the finger of God.
Of course, it is traditionally held that a portion of Exodus was not written by Moses, but by God Himself, and in stone. So we will gladly concede the point that Moses must have copied some of his book from God's book, and need not have written every word originally. It is also widely accepted that the description of Moses' death was written by Joshua or Aaron or some other later witness.
Numbers 33:2 – Now Moses wrote down the starting points of their journeys at the command of the Lord.
Here Moses is only said to have written down the points along the journey. I can't find any specific references to passages in Numbers from any writers asserting it as the words of Moses. So perhaps the author of Numbers was someone else. But my search for textual evidence has been very cursory.
Deuteronomy 21:34 – So it was, when Moses had completed writing the words of this law in a book, when they were finished…
Other Old Testament writers assert Mosaic authorship
Joshua 8:32 – And there, in the presence of the children of Israel, he wrote on the stones a copy of the law of Moses, which he had written.
Nehemiah 8:14 – And they found written in the Law, which the Lord had commanded by Moses, that the children of Israel should dwell in booths during the feast of the seventh month [referring to Leviticus 23:34, which says]
Leviticus 23:33,34 – Then the Lord spoke to Moses, saying, “Speak to the children of Israel, saying: ‘The fifteenth day of this seventh month shall be the Feast of Tabernacles for seven days to the Lord.’”
Daniel 9:11,13 – As it is written in the Law of Moses, all this disaster has come upon us…
New Testament writers assert Moses as author of the Law
Mark 12:26 – "But concerning the dead, that they rise, have you not read in the book of Moses, in the burning bush passage, how God spoke to him, saying, ‘I am the God of Abraham, the God of Isaac, and the God of Jacob’?"
In this interesting quote, the Lord Jesus refers to the book of Moses, which can only mean Exodus here, where God relates himself to the patriarchs written about in the book of Genesis. This doesn't imply Mosaic authorship of Genesis, but Moses was keenly aware of all that Genesis taught about Abraham, Isaac and Jacob. The more likely explanation of the book of Genesis is, not that it was written later, but much earlier, or rather, was transmitted orally until someone like Moses, a royally-educated man, finally put it down in writing. So Moses may not have composed Genesis at all. Since we're not told in the text, the tradition will have to suffice, or be replaced with modern-day theories.
John 1:17 – For the law was given through Moses, but grace and truth came through Jesus Christ.
John 1:45 – Philip found Nathanael and told him, “We have found the one Moses wrote about in the Law, and about whom the prophets also wrote—Jesus of Nazareth, the son of Joseph.”
Here, John and Philip assert Mosaic authorship of the Law (the Pentateuch), or at least some parts of it.
John 7:19 – Did not Moses give you the law, yet none of you keeps the law?”
Jesus also believed Moses as the lawgiver. In order to dismiss Moses' authorship, we must conclude Jesus had no correct knowledge of the matter. I have no doubt, many of the textual critics consider themselves to have greater knowledge of the matter than the Lord, but I do not have the conviction that their theories are completely fireproof.
Acts 7:37 – “This is that Moses who said to the children of Israel, ‘The Lord your God will raise up for you a Prophet like me from your brethren. Him you shall hear.’”
Here St. Stephen also has settled the matter of Mosaic authorship, at least of Deuteronomy, and quotes this Mosaic prophecy of the Christ to the Pharisees of his day, and dying a martyr's death for his, um, hermeneutical approach.
1 Corinthians 9:9 – For it is written in the law of Moses, “You shall not muzzle an ox while it treads out the grain.” [Deut 25:4]
Here the Apostle Paul seems content to accept Moses as the author of Deuteronomy.
Romans 10:5 – For Moses writes about the righteousness which is of the law, “The man who does those things shall live by them.” [Leviticus 18:5]
2 Corinthians 3:15 – But even to this day, when Moses is read, a veil lies on their heart.
Hebrews 9:19 – For when Moses had spoken every precept to all the people according to the law, he took the blood of calves and goats, with water, scarlet wool, and hyssop, and sprinkled both the book itself and all the people. [Exodus 24]
The book itself is described in the event recorded therein. This could mean "the scroll that was at that time already written", which would refer to an earlier chapter in the completed book of Exodus, or it could be some kind of addition added by a hypothetical deuteronomist at a much later date. The reader is encouraged to think and judge for himself which is the more likely explanation.
It's not JUST tradition...
The contention that the Mosaic authorship of the Pentateuch is merely traditional needs to be qualified: This tradition is based on exegesis of the Scriptures themselves. To say Moses was not the author of at least most of the Pentateuch, is entirely conjecture. However academically brilliant this conjecture, it contradicts the Scriptures of which it speaks. I suppose such textual criticism is acceptable as a type of hermeneutic. But it seems to be rather destructive of the Scriptures as Scripture, leaving them to be discarded as mere tales and myths which have been shot full of holes by modern intellects. And I suppose this criticism is even more persuasive to some than the Scriptures, not to mention doctrine, theology, and bandwagons full of Jewish and Christian scholars of the past and present. So I will not quote or name them. But this tradition wasn't just a pronouncement of some venerable Rabbi, council, creed or pope; it is entirely based on the Bible from which this forum derives its very name.
How could Moses have written the Pentateuch?
At this point, we should think about the question of "how" in the original question. Moses was the most highly educated Jew ever to walk the earth. He was educated in the Palace of Egypt, and likely had learned several languages. How, as it pertains to his ability, is a moot point. How could he know what to write? Well, his intellect was certainly used by God in the task. Anyone who writes has to think and compose words to represent the thoughts. Moses could do that. If, as he claims, God told him what to write, well, there's your answer to any other matters of how, not based on conjecture, but on what HE WROTE (see quotes above).
Or perhaps the question really only means, "How could Moses have written ALL of them, every word?" I don't think it is necessary that he wrote every word, as I've already argued. But I ascribe to the doctrine that all scripture is inspired by God, stated plainly in in Exodus 24:4*ff* and II Timothy 3:16. So I don't really care if there were ten or twenty authors involved; it's still God's holy word. The verses above only ascribe the Laws and the books to Moses. He may have had assistants and co-authors and translators and a whole team of editors. I'm not bothered that he gets the full credit, because he ascribes the ultimate credit to God. Your doctrine may differ, in which case this hermeneutic may not work for you. No offense is intended.
What If Moses did not write the Pentateuch?
At this point, it is helpful to ask the question the OP didn't ask: What if the Pentateuch was not written by Moses? This is not a hard question at all. Iff Moses did not write1 the Pentateuch, whoever did included quite a number of falsehoods, lies and fictions, sufficient to deceive all the Jews of Moses' day, Joshua, Nehemiah, and numerous other OT writers, and ALL the NT writers, including Jesus, and all the brilliant scholars and interpreters up until 1520 [see Dick's answer]. If Moses did not write at least a portion of the books of the Pentateuch, then the entire doctrine of Inspiration held by said writers (most notably Moses and Paul) is also false. For verses like Dt 21:34, for example, ("So it was, when Moses had completed writing the words of this law in a book...") would be false, and an inspired book could not contain such false statements. If there is nothing God-inspired in the Pentateuch, then the Bible as a whole is not inspired, and thus, both the Jewish and Christian faiths are based on fictions and fantasy. Then tthere is no reliable authority for what we believe at all, except of course the individual, who may hold any theory at all. And, of course, if these scriptures are full of fictions and lies, well I submit that the very art and science of hermeneutics (and most of what is written in this forum) is all a very sad self-delusion.
1 By which I include what he himself wrote, or penned from what was handed down to Him, whether in oral tradition or written by God, or what his assistants and successors may have added. The point here is not that Moses wrote every word, but that what was written by him was the majority, the gist, and the substance of what has been handed down to us from God.