Ancient writers didn’t write by the standards we use today. They didn’t have the same ideas about intellectual property and plagiarism that we have, so writing in someone else’s name or without citing sources was acceptable. Often writers (or rather scribes) were working for a king, producing what we might consider propaganda. The identity of an author was therefore not important, and so ancient texts very rarely say who composed them.
The Hebrew Bible is no exception: it says very little about who wrote its books, though traditions have developed about authorship regardless. For example, Jewish tradition says that Moses wrote the Torah (b. Baba Batra 14b). Other books of the Hebrew Bible, like those named after prophets, are traditionally attributed to those prophets. But very few biblical books contain specific accounts of who wrote them. The book of Jeremiah is one of the few that does, describing how Jeremiah dictated the text to the scribe Baruch (Jer 36:1-4).
Even in the case of Jeremiah, however, there are indications that a single person did not write the whole book. Another account in the book reports that Jeremiah, not Baruch, did at least some of the writing (Jer 51:60). The Hebrew edition of the text contains material not preserved in the earliest Greek translation, the Septuagint, suggesting that there was a variant edition of the book with added material.
Many other biblical books contain similar evidence that they were written or edited well after the periods that they concern. Daniel is a good example. The book is set in the Babylonian and early Persian periods (sixth and fifth centuries B.C.E.). But a number of aspects of the book, such as its use of the late genre of apocalyptic and its thinly veiled references to later events (see especially Dan 11, which describes events in the two centuries after the death of the “warrior king” Alexander the Great in 323 B.C.E.), make clear that it was written in the second century B.C.E.
Similarly, the books of the Torah bear markers that Moses did not write them. First of all, they don’t ever say he did! They only mention Moses writing certain parts. God is also said to have written certain parts (namely, the Ten Commandments). The end of the Torah reports Moses’ death—making clear that he could not have written it all. In addition, a number of stories are repeated, sometimes with conflicting details that show that they must have been independent traditions at some point (compare, for example, Gen 1:1-2:4 with Gen 2:5-3:24, or Exod 17:1-7 with Num 20:1-13).
Repetitions, inconsistencies and contradictions, and the use of different narrative styles and vocabulary have led scholars to propose that there were multiple authors of the Torah, whose works were composed independently and combined by a later editor. This model, called the Documentary Hypothesis, stipulates four authors: J, E, D, and P, each named for a feature of its narrative: J favors the divine name Yahweh (Jehovah in German); E, the name Elohim; P is concerned with priestly matters; and D is limited largely to the book of Deuteronomy. An editor then combined all four sources in one or two stages. Other models suggest that the text developed in a more complicated and layered fashion, building on previous material that various authors and editors sought to supplement or even supersede. Despite the differences between these approaches, scholars still generally agree about which parts of the text derive from different authors.
Scholars also think that the books of Joshua, Judges, 1-2 Samuel, and 1-2 Kings include older traditions that were woven together with newer material by a later editor. This editor was apparently sympathetic to the worldview of Deuteronomy, especially the themes of covenant and idolatry, and so these books are often called the Deuteronomistic History. The figure (or group) who brought them together is called the Deuteronomistic Historian.
The prophetic books are named for the prophets whose oracles, works, and words they feature. Many scholars conclude the prophetic books were written by those prophets’ followers, sometimes within or shortly after the prophet’s lifetime. However, these books don’t usually contain an account of their composition, and many of them contain traces of editing from later periods. Probably these original followers continued to use and add to the books after the prophets’ deaths.
The authors of many other books of the Bible are even harder to identify. Traditionally, the Song of Songs was attributed to King Solomon, either because of his reputation as a lover or because of his wisdom, thought to be reflected allegorically in the book. But the poetry of the Song of Songs also bears markers of a later stage of Hebrew than the language that was used at the time of King Solomon (about whose existence there is very little historical evidence), and so most scholars think that it was likely written much later. The same is true of the books of Ecclesiastes and Proverbs, also traditionally associated with Solomon.
Because of King David’s reputation as a musician (1Sam 16) and because the psalms were originally sung (there is no difference in Hebrew between the word poem and the word song), a number of psalms contain a superscription linking them to David. In fact, these are secondary additions based on the tradition that David wrote psalms. The vast differences in content, language, and style, though, make it very unlikely that a significant number of them were written by a single person. As with Solomon, there are linguistic and other problems with this tradition of Davidic authorship. Likely the Psalms come from a variety of authors; some of the psalms may indeed be very old and probably developed as prayers for use in Israelite religious practice.
Were all biblical books written by men? It’s likely that this was the case. Though books like Esther and Ruth, which are named for female protagonists, might be candidates for female authorship, subject matter is no guarantee of authorship. Some scholars have suggested that the Song of Songs could have been written by a woman because much of its poetry is seen as accurately reflecting a woman’s experience. However, literacy was not very widespread in ancient Israel and it’s likely that very few women would have been literate. Most literacy would have focused on the palace and the temple and would have been limited to the male officials who worked as scribes in those places.