Executive summary: Learning patterns and sequences and choosing the best learned motor program that fits the perceived situation.
You might like the model of consciousness that is found earlier in the thread.