From Chapter 10 of Hayek’s terminally under-read Constitution of Liberty, and the second place I’ve discovered so far of his use of the formation of crystals to illustrate the emergence of a spontaneous order in society:
“Though people more familiar with the manner in which men order physical objects often find the formation of such spontaneous orders difficult to comprehend, there are, of course, many instances in which we must similarly rely on the spontaneous adjustments of individual elements to produce a physical order. We could never produce a crystal or a complex organic compound if we had to place each individual molecule or atom in the appropriate place in relation to the others. We must rely on the fact that in certain conditions they will arrange themselves in a structure possessing certain characteristics. The use of these spontaneous forces, which in such instances is our only means of achieving the desired result, implies, then, that many features of the process creating the order will be beyond our control; we cannot, in other words, rely on these forces and at the same time make sure that particular atoms will occupy specific places in the resulting structure.
Similarly, we can produce the conditions for the formation of an order in society, but we cannot arrange the manner in which its elements will order themselves under appropriate conditions. In this sense the task of the lawgiver is not to set up a particular order but merely to create conditions in which an orderly arrangement can establish and ever renew itself. As in nature, to induce the establishment of such an order does not require that we be able to predict the behavior of the individual atom—that will depend on the unknown particular circumstances in which it finds itself. All that is required is a limited regularity in its behavior; and the purpose of the human laws we enforce is to secure such limited regularity as will make the formation of an order possible.”