Michael D. Coogan, The Old Testament: A Historical and Literary Introduction to the Hebrew Scriptures, third edition (Oxford University Press, 2014), 5.
Several overlapping criteria were used in including a work in the canon. One criterion was date: For a book to be included, it should have been written before the fourth century BCE or attributed to an author who had lived before then. Another criterion was language: For a book to be included, it should have been written in Hebrew; however, although some parts of Ezra and Daniel were written in Aramaic…they were largely in Hebrew, and so this did not count against them. A third criterion was extent of use. The last criterion also could affect the order of books; thus, the books of Song of Solomon, Ruth, Lamentations, Ecclesiastes, and Esther, collectively known as the five megillot, or “scrolls,” frequently (although not always) occur in that order because of their being read on a specific holy day in the liturgical cycle: Song of Solomon at Passover, Ruth at Shavuot (Weeks of Pentecost), Lamentations at Tisha B’Av (the ninth day of the month of Av, when the Temple in Jerusalem was destroyed), Ecclesiastes at Sukkot (Booths), and Esther at Purim.