Thinking derives from mental learning. Learning is the process of acquiring information. Primitive thinking starts as automatic processes of associations and they occur already among highly developed animals. Mentality in the manifestation of the brain learns by creating more connections between its nerve cells. There are different ways of learning, but the most primitive one is associative learning.
Automatic learning: conditioning
The automatic ways of learning are the most primitive ones and they already occur among animals. They are about conditioning processes and the most famous researcher into this was the Russian physiologist Ivan Pavlov. He focused on the observable behaviours instead of trying to interpret the unobservable internal mental processes.
As a medicine man he studied dogs’ stomachs and discovered that dogs salivate at a mere indication of a dinner. He conducted famous experiments to explore how dogs can associate originally neutral stimuli with the delivery of food and so learn to react to the stimuli accordingly.
Neutral stimuli are events which normally don’t cause any particular reaction in dogs. However, if you frequently pair the presence of meat powder with neutral stimuli such as a certain sound, a shining light etc., the dogs start drooling when the stimulus occurs, although no food has been presented yet.
The conclusion is that animals exhibit associative learning. They can connect neutral events with certain events, a method of learning which turns a neutral stimulus into a conditioned one, because it evokes a reaction which normally would be caused by another event. This process of associative connecting is the most elemental form of how mentality learns.