Let us begin by dividing all the books of the Prophets known to us into two groups. The first includes Joshua, Judges, Samuel, and the Book of Kings. The second includes Isaiah, Jeremiah, Ezekiel, and the 12 Minor Prophets.
The book preceding the Book of the prophet Samuel is Shoftim (Judges). The book following Samuel is Melachim (Kings). Both the Book of Judges and the Book of Kings discuss the laws of kingship and the form of government. The main figures in the Book of Samuel are, initially, the prophets Eli and Samuel himself, and, in the second half, the kings Saul and David.
It would seem that the Book of Samuel could be “cut” in half, with the first half attached to Judges and the second to Kings. Yet we see that the opposite is true: Samuel is set apart from the Book of Judges and David from the Book of Kings, and they are brought together in a separate Book of Samuel. This is because Samuel is greater than all the other judges, and David is greater than all the other kings. Setting them apart in this way ensures that Samuel and David do not “get lost.”
As for who wrote the Book of Samuel, tradition says that Samuel himself wrote it from the beginning through chapter 25 (he dies in chapter 25); two of his contemporaries, the prophets Nathan and Gad, completed the book.
Samuel also wrote the Book of Ruth and the Book of Judges.
From chapters 17, 18, and 19 of the Book of Judges, we learn of two stories that are extremely painful and shameful for us, involving a sin committed by people against G-d and a sin between one person and another. The first story: Micah, who lives in the hill country of Ephraim, creates an idol served by a Levite from Bethlehem in Judah (clearly, this is a sin between a person and the Almighty).
The second story is described in chapter 19 and concerns rape and murder. The main figures here are a Levite living in the hill country of Ephraim and his concubine-wife from Bethlehem in Judah, who is raped and killed (a sin between one person and another).
Thus, the Book of Samuel is preceded by two terrible accounts, each involving a Levite connected to the hill country of Ephraim, as well as someone from Bethlehem in Judah. The people involved in the two crimes seem to “echo” one another.
Every sin damages the world. Grave sins do so all the more.
The Book of Samuel tells of people who will come from those same places and repair the damage done by their predecessors. Samuel's father is a Levite from the hill country of Ephraim. King David is from Bethlehem in Judah. Essentially, the very same forces are at work, only now they are directed toward the opposite goal—setting the Jewish people right. But more on that a little later.