In the first book of The Republic, Thrasymachus and Socrates discuss that the nature of justice. As a part of this discussion, Thrasymachus declares that justice is the advantage of the stronger. A good law is therefore one which helps the ruler, and a bad one harms him. Yet such conditions would make the impossible, possible; a law could be both just and unjust. If Thrasymachus is correct, then when a ruler errs, and makes a law which harms him, it would be unjust with regard to his making of it but at the same time it would be just with regard to the subjects, for whom justice is the following of laws.
To evade this conundrum, Thrasymachus introduces a more nuanced approach, one which ultimately undermines his position. He states that the ruler is only a ruler insofar as he rules, or expresses the τεχνή (skill) of ruling. Socrates jumps on this, and proceeds to prove that a ruler insofar as he rules, rules for the advantage of his people.
A τεχνή, says Socrates, seeks the advantage of nothing save that of which it is the τεχνή. If a ruler is a master at the τεχνή of ruling, and if a τεχνή rules over and is stronger than the things of which it is the τεχνή, than just as a doctor does not seek his own benefit but that of the body and the captain does not seek his own advantage but that of his sailors, so also the ruler as ruler does not seek his own benefit but that of his people.
It may be objected, as Thrasymachus does, that experience shows men treating their people like sheep. That which man calls justice, always harms him while that which man calls injustice, always helps him. Socrates replies just as an eye cannot fulfill its end with its virtue impaired, so also cannot men. The virtuous man will fulfill his end rightly, and the vicious man will not. Justice is a virtue of the soul, so the just man will live well. It never profits a man to live unwell, so it can never profit a man to live unjustly.