The background to Plato's treatment of rulership in the Republic is both philosophical and biographical. On a biographical level, the account of Plato's sojourn in Syracuse in Epistle VII suggests that Plato's personal experience was that rulers were not able to devote themselves to philosophy and that the quest for philosophical truth was incompatible with the compromises necessary for rulership.
For Plato there is considerable tension between the need for philosophically trained rulers, who are unselfishly devoted to knowing and practicing goodness, justice, etc. and the fact that true philosophy finds its fullfillment in the theoretic life of contemplation of the Form of the Good. The philosopher who has left the cave will not disire to return to it, but for the sake of the community as a whole, must do so. The inherent tension is that the philosopher who knows the good must act in a benevolent manner for the good of the community, but active practical benevolence is a distraction from contemplation of and return to the divine.