With the time, the money and the effort that a case at court of law requires, it is better to make a compromise with the one you are involved in disagreement with, even though it might be not so much on your advantage, rather than go the the court of low.
The proverb teaches wise and careful decision making.
Note that there is spread another version of this proverbs that goes: A bad corn promise is better than a good lawsuit. The words corn primise are actually a type of the word compromise.