According to a talmudic discussion of the authorship of the various books of the Hebrew Bible, Moses composed not only the Pentateuch but also the book of Job and “the portion of Balaam” (parashat Bilam). The identity of the last item has puzzled scholars for centuries: if it refers to Numbers 22-24, which describe the attempt by King Balak of Moab to hire the prophet Balaam to curse Israel, and the divine blessings that Balaam utter instead, why does the Talmud distinguish between this passage and the rest of the Pentateuch? And if it refers to something other than this passage in Numbers, does it refer to a book no longer extant? Shlomo Zuckier discusses the possible explanations floated by rabbinic commentators throughout the ages:
The 17th-century sage Isaiah Halevi Horowitz, [citing earlier authorities], asserts: . . . “the portion of Balaam” must be a short book written by Moses, one lost due to the travails of exile. . . . The discovery of an ancient text in Deir ‘Alla, Jordan, in 1967 set off a flurry of publications on the matter. The text explicitly refers to one “Balaam son of Beor” and also contains significant thematic parallels to the biblical Balaam story, albeit with some differences. On this basis, some have suggested that this document, or something very much like it, may be what the [Talmud] refers to. . . .
However, several commentators point to some fundamental difference in nature between the passage in the Torah about Balaam and the rest of the Torah that might account for [our talmudic passage giving special treatment to the former]. There are several versions to this approach. A first angle is that this material, while it appears in the Torah, is in some sense inferior or tangential to the rest of the Torah. . . .
[Conversely, one ancient rabbinic work] notes that while “no prophet arose in Israel like Moses” (Deuteronomy 34), such a prophet did arise among the Gentiles, namely Balaam. Rabbi Tsadok Rabinowitz of Lublin (1823-1900) explains this to mean that Balaam’s prophecy was of a unique nature, a type that only Moses possessed. . . . Moses and Balaam prophesied by having God, as it were, speak through their mouths. Thus . . . the prophecies of Balaam themselves are exceptional, as they represent the unmediated word of God spurting forth from his mouth. . . . If so, Balaam’s prophecies are exceptional because their inclusion within the Torah is on account not of their Mosaic authorship but of their divine construction. Thus, they belong in a category all their own, and the Talmud appropriately separates them from the rest of the Torah.