I have this thought. In many stochastic environments, over a long interval, patterns emerge that occupy an optimal position. This is how structure arises, for example cognitive structure and possibly consciousness.