Many ultra-Orthodox Jews believe Moses wrote the Torah and that the story of his death was penned in by Joshua, but this is a minority opinion within Judaism. Many modern Jews, along with most modern Catholics, acknowledge that there is a long-standing traditional belief that Moses wrote the first five books of the Bible, but they accept the possibility that these books could have been written and compiled by others and attributed to the authorship of Moses.
One possibility for how this might have worked might be that a group of scribes and scholars wrote the first five books and the books were promulgated under Moses’ authority, either during his lifetime or (more likely) after his death. We see a similar phenomenon in the Church today. Papal encyclicals rarely are written solely by the pope under whose name they are promulgated. A pope usually has churchmen who are knowledgeable in the disciplines he needs to address draft an encyclical, which he then reviews, edits, adds to, etc., and eventually publishes as his own because the authority under which it is released is the papal office.
In a similar fashion, this might be why some books of the Bible, or parts of books, are attributed to someone with authority from God (e.g., Moses, Kings David and Solomon, the Apostle Paul) but might have been, at least partially, the work of others.
Recommended reading:
What is Biblical Criticism – and Should We Trust It? by Fr. Peter Funk, OSB