The brain’s pattern recognition circuits take raw data from the senses, sort through it for apparent patterns, and use those patterns to determine a response.
The ability to accurately predict the future based on recurring patterns is crucial to everything from hunting and gathering (snakes with cylindrical heads are mostly harmless; snakes with triangular heads could kill me) to mate selection (animals with the most symmetrical, or highly patterned, features tend to be the fittest, and hence the most popular sexual partners)
Once a pattern has repeated itself long enough, it starts to influence behavior. Because lush meadows were found to reliably surround lakes and streams, for example, our brains came to associate green grass with fresh water.
Using this type of analogical reasoning, we also began comparing situations to decide whether a new object or environment was sufficiently like a previous object or environment to ensure a steady supply of food and water. Survival depends on having the fittest pattern recognition circuits.