This allegory builds on the allegory of the sun found at the end of Book VI. That allegory draws upon a distinction between the intelligible and visible realms. We're asked to make the following analogy (my representation only slightly garbled by blogger formatting constraints):
sight :: understanding
SUN :: GOOD
visible things :: intelligible things
SUN :: GOOD
visible things :: intelligible things
We have faculties of sight and of understanding. Just as our faculty of sight and the presence of a visible thing is not sufficient for a successful instance of achieved vision, so our faculty of understanding is not by itself enough to grasp the intelligibility of a thing. In the first case, we need the sun to illuminate the space in which seeing might take place; so too, Plato claims, we require the form of the good in the second. And, just as the sun, besides providing a space of illumination, is itself an object of vision, so we are asked to believe that the good is itself an object in the intelligible realm, available, to those with proper training, for direct contemplation. Unfortunately, Plato doesn't offer much by way of explanation as to what the good is such as to do all of this work. If I have time I'll ask around or look at some secondary literature to find if there's something big I'm missing. Allegory can be helpful pedagogically, or as a heuristic, but it's not in general a sound argumentative technique.
Another implication to which Plato/Soc calls our attention is that education is not a matter of filling in a lack, pouring material into a vacant space in the soul, but is a matter of appropriately directing the rational faculties (518). Without making too much of it, Plato here offers a nice piece of evidence in support of some of his claims about the realm of forms. Reason, he says, is not something learned by practice in the way we acquire the bodily virtues. Hence he is able to dub it a "divine" attribute (518d-519a). If this seems like a plausible description of our rational faculties, then the existence of a more-or-less divine realm of forms accessible to it will also seem, in turn, a bit more plausible than before.
(In an interesting with disanalogy with the case of the sun, Plato/Soc claims that when the philosopher gets the good directly in his sight, only the call of justice will bring him back to the cave of political life. Plato/Soc makes it pretty clear that this is a genuine sacrifice on the part of the philosopher: the best life is one spent alone in contemplation of the good. Later, at 532b, he recurs to this theme, claiming that to view the the sun itself is to reach the "end of the visible" -- nonsense, in my view, if "end" here is a translation of "telos".)
The next issue to be considered, and which will occupy the remainder of this book, is the kind of education most conducive to the production of philosopher-kings in contact with the good. The program, in outline, is an initial education in music and poetry, physical training, and basic math, followed by a few years of compulsory physical training, then (for those successful thusfar) ten years of math, five years in dialectic, and (for those still in the program) fifteen years in practical politics. (That's about 35 years, in all -- and this from a time of comparatively low life-expectancy.)
I find a lot of this discussion to be of rather limited philosophical interest, arguing for a certain implementation of his program from sometimes arbitrary pragmatic considerations. The role assigned to mathematics, however, certainly bears comment, along with a few other remarks made in passing.
True philosophy is said to turn the soul "from a day that is a kind of night to the true day," which will involve an ascent from the realm of becoming to the realm of what truly is (521c-d). (This being-becoming opposition appears again at 526e with similar a valuation.) It is mathematics that will emerge as the next step in this education. Distinguishing numbers and calculating is said to be a subject touching all crafts (522c). Both a basic grasp of number and arithmetic and then, in a separate discussion, geometry are defended as relevant both for the art of war and for practicing philosophy. (The discussion of number and philosophy includes a fascinating foray into the metaphysics of perception, but I'm going to pass over this as tangental to our main interests in the text.) They are valuable in war for logistical reasons, and valuable to philosophy because they turn the soul toward unchangeable realities (numbers, shapes) beneath our world of appearances.
The subject of the dialogue changes somehow (under the influence of the sun analogy?) to astronomy, and it is established that the proper emphasis of astronomy is not on the celestial bodies themselves, but on the harmonies and ratios that their motions exhibit.
The next subject for our philosopher-kings-in-training is dialectic. Dialectic is that through which, apart from all sense perception, one attempts to find "the being itself of each thing" (532a). In contrast to mathematics, which begins with agreed upon hypotheses and moves toward conclusions, dialectic works toward establishing first principles (533b). It is essentially the art of philosophical argumentation, and is said to be that by which we progress to the good itself (532a-b). One properly trained in dialectic "can distinguish in an account the form of the good from everything else, can survive all refutation, as if in a battle, striving to judge things not in accordance with opinion but in accordance with being, and can come through all this with his account still intact" (534b-c).
A final suggestion, to close this book, that "the quickest and easiest way for the city and constitution we've discussed to be established" is to "send everyone in the city who is over ten years old into the country[....then] take possession of the children, who are now free from the ethos of their parents, and bring them up in [our] own customs and laws" (540e-541a). All for the greater good!