The cerebral cortex is just the outer shell of the brain, a rind about a tenth of an inch thick. By weight, it's a very small part of the brain, but it's in charge of linking up new sensations and thoughts with one another. In particular, the cortex is very important for all the things that we humans can do better than the apes. The higher intellectual functions are mostly examples of structured thinking, not just simple association. Children's brains come equipped with wiring that can discover the syntax of whatever language they hear, usually before the age of three.
Foresight often involves structure.
And there is a real liking for games with arbitrary structural rules to follow, such as hopscotch or solitaire. Kids will even make up new rules as they go along, just to make it more interesting. We know most about the structuring from Chomskian linguistics, because it tells us a lot of structural things that are impossible for the brain to do in any language. Nothing like higher intellectual function is seen in the great apes. The cortex is in charge of novelty, not routine.