Book of Deuteronomy have given various answers to the problem. The Deuteronomistic history theory is currently the most popular (Deuteronomy was originally just the law code and covenant, written to cement the religious reforms of Josiah, and later expanded to stand as the introduction to the full history); but there is an older theory which sees Deuteronomy as belonging to Numbers, and Joshua as a sort of supplement to it. This idea still has supporters, but the mainstream understanding is that Deuteronomy, after becoming the introduction to the history, was later detached from it and included with Genesis-Exodus-Leviticus-Numbers because it already had Moses
Book of Exodus accept God as a cause of events, but in Exodus, everything is presented as the work of God, who appears frequently in person, and the historical setting is only very hazily sketched. The purpose of the book is not to record what really happened, but to reflect the historical experience of the exile community in Babylon and later Jerusalem, facing foreign captivity and the need to come to terms with their understanding of God. Although mythical elements are not so prominent in Exodus as in Genesis, ancient legends have an influence on the book's content: for example, the story of