Socrates says the tyrant indulges in pleasures in his youth. The tyrant can't control his desires and indulges them shamefully. All of his appetites are unrestrained, and he sees enemies everywhere. All relationships are seen in terms of a master and a slave, and he himself is a slave to his appetites and passions.
The just man governs his appetites, and his reason and true knowledge are in control. He can choose his actions and is therefore happier than the tyrant.
Socrates see the tyrant as unhappy because he can't control his desires.
Just as there are three parts to the soul, there are three types of men. The just man is governed by reason and seeks knowledge. The Timocratic man is governed by his spirit and seeks honor. The third type, governed by his desires, seeks profit and satisfaction. He is a combination of the Democratic, the Oligarchic and the Tyrant. Each of these would describe himself as the happiest of men, because there are three sorts of pleasure, the pleasure of knowledge, the pleasure of honor and success and the pleasure of profit.
In Book VII Socrates argues that justice involves searching for understanding of the Forms, and imitating them, thus making justice itself good since the Forms are the source of all good. Now he prepares to argue that a just life is a happy one.
The just man, who has experienced all three forms of pleasure, knows the pleasures of knowledge to be best because others are physical, illusory pleasures that do not last. The pleasure of food is only pleasurable because of the absence of hunger. The objects of knowledge are ideas and hence true and real, whereas physical objects are illusory.
Earlier, Socrates related justice to moderation, as he does here, when he describes reason ruling spirit and appetite in the just man, so that all three portions of the soul are functioning properly.
The unjust man, by ignoring reason, makes himself miserable. He starves his reason, his best and most human aspect, and feeds his appetites and desires. A man who wishes to lead a good and happy life must be led by reason. If his own reason is not enough to guide him, he must be led by the reason of others, as the producers are led by the philosopher-kings.
Reason exercises control, so neither appetite nor spirit dominate in the just and happy man. The just man is a version in miniature of the just city. In the city, the philosopher-king rules the auxiliaries and the producers, just as the rational soul governs will and spirit (the emotions), and the appetites.