to judge: to exercise rightful authority over a person or dispute and set it right, whether by deciding a case, ruling a people, defending the wronged, or punishing the guilty
In English we keep "judge" mostly inside a courtroom, but this Hebrew word reaches much wider. At its center is the authority to put a situation right. From that one center the word fans out in ways that can surprise a modern reader.
First it is what a judge does: hears a dispute and decides it justly. But the same word is what a ruler does. The leaders in the book of Judges were not seated on a bench weighing lawsuits; they led the nation, fought its battles, and delivered it. To judge Israel was to govern Israel. The word slides this way because in that world ruling and judging were the same office.
The word also has a direction. To judge can mean to come down on the side of the wronged, to give justice to the orphan and the poor, which is why the Psalms can cry "judge me" as a plea for rescue, not a fear of condemnation. Pointed the other way, to judge the nations means to bring them to account and punish them. And in its reflexive use two parties enter into judgment together, going to law to have their quarrel settled.
These are not separate words that happen to be spelled alike. They are one authority seen from different angles: the one who decides, who rules, who defends, and who punishes is doing a single thing, setting the world right.