The theme for the events in Judges 17-21 is that everyone did what was right in their own eyes because they had no king. In Judges 19-21, this plays out through a Levite whose concubine is killed by men in Gibeah (in Benjamin). The Levite rallies Israel around this disgrace and they exact revenge. But in doing so, they leave Benjamin with no way of existing into the future, a problem they solve through deceit. The book ends with this statement: "In those days there was no king in Israel. Everyone did what was right in his own eyes."
The only way through this is to know what the book of Judges foreshadows: we have a king, Jesus, whom we must submit to and serve.