Plato, in The Republic (507b-509c) uses the sun as a metaphor for the source of "intellectual illumination," which he held to be The Form of the Good, which is sometimes interpreted as Plato's notion of God. The metaphor is about the nature of ultimate reality and how we come to know it. (Socrates is the speaker of The Republic, but it is generally believed that the thoughts expressed are Plato's.)
The eye, Plato says, is unusual among the sense organs in that it needs a medium, namely light, in order to operate. The strongest and best source of light is the sun; with it, we can discern objects clearly. Analogous things, he writes, can be said of intelligible objects (i.e., the fixed and eternal forms that are the ultimate objects of scientific and philosophical study):
- When [the soul] is firmly fixed on the domain where truth and reality shine resplendent it apprehends and knows them and appears to possess reason, but when it inclines to that region which is mingled with darkness, the world of becoming and passing away, it opines only and its edge is blunted, and it shifts its opinions hither and thither, and again seems as if it lacked reason. (The Republic bk. VI, 508d; trans. Paul Shorey)
Plato also says the sun and the Good ("the object of knowledge") are both sources of "generation":
- The sun ... not only furnishes to visibles the power of visibility but it also provides for their generation and growth and nurture though it is not itself generation. ... In like manner, then ... the objects of knowledge not only receive from the presence of the good their being known, but their very existence and essence is derived to them from it, though the good itself is not essence but still transcends essence in dignity and surpassing power. (509b)
This doctrine conveyed by the metaphor of the sun is, incidentally, an excellent example of how, traditionally, the subjects of metaphysics and epistemology have been closely intertwined: accounts of what exists, at a fundamental level, often deeply inform (and are informed by) accounts of ways or kinds of knowing. It also neatly sums up two views for which Plato is well-known: his rationalism and his realism (about universals).
Plato goes on to describe the levels of reality and knowledge with the device of the so-called "divided line (509d-513e). Immediately afterwards, at the beginning of Book VII, the same doctrine is elaborated using the famous allegory of the cave (514a-520a).