The Book of Judith is an edifying narrative (see introduction of Esther). It was inspired by records and legends of the national resistance at the time of the Maccabees.
There was a promise made by God to Abraham (Genesis 12:2-3); it is insisted upon more clearly in Leviticus 26 and Deuteronomy 28. According to this promise, God would defend his people when they were faithful to the Law, but would deliver them to their enemies whenever they did not follow the Law.
The Book of Judith (Judith means the Jewess) attempts to demonstrate that God keeps his promise.
God’s people returned from exile a short time before. They rebuilt the capital, Jerusalem, restored the Temple and the worship of God, and were resettling in the entire country. In short, they were living a period of faithfulness to God and, according to his promise, God would protect them.