This story is told in Plato's Republic. The details can be found here.
This paper will address the concept of the “noble lie” in Plato’s Republic. It will begin by explaining the justification for the noble lie given by Socrates in the passages of 389b-c, which foreshadow the direct discussion of the lie which appears later in the text.
The second part of the noble lie specifies that, although they are all brothers, the citizens’ souls are nonetheless constituted of different materials. When each citizen was created, “the god mixed gold in the production of those . . . who are competent to govern” (333; 415b). The souls of auxiliaries contain silver, and the souls of the farmers and artisans contain iron and bronze. Souls of offspring would usually be of the same constitution as their parents, but occasionally offspring are born bearing the quality of a different metal. In such cases, it is vitally important they be raised according to the material in their soul. So essential is it that the character of these metals be respected, that Socrates builds the myth into the noble lie, recommending that an oracle warn that the city will be destroyed on the day when a “guard with iron or bronze in him is on duty.” In view of such consequences, citizens will fear lying about their children’s souls (333; 415c). Socrates then acknowledges that it will be difficult to convince the first generation to believe this lie, but also notes that the later generations will be more likely to accept the lie if it becomes popular tradition.