What is learning?
Learning is the process by which we are able to perceive important information and encode it for later use. It is one of the primary traits that separates humans from other animals and enables higher learning and complex organization. Mammals have a distinct advantage over other animals because we have an endocannabinoid system that allows the circuits in our brain to make finely-tuned adjustments to our perception.
The average baseline pattern-recognition ability of the untrained human brain is on par with the most sophisticated supercomputers, and it is this ability that allows us to form complicated thoughts and ideas and to survive daily in a complex and intricately orchestrated societal network; it is what allows society to exist in the first place.
The exact mechanism of memory has been the topic of debate for thousands of years, and the first computers were designed based on the contemporary understanding of human learning processes. What we know is that our memory is closely tied to emotion, and the part of the brain that manages emotional perception is also the part of the brain that is active in encoding new memories: the hippocampus. Several parts of the brain work together to produce memory, and the hippocampus is like the quarterback of the processes.
How learning works
The order of any thought generally follows this form:
First, the thalamus receives and processes sensory information.
It then sends this newly organized data through the amygdala, which determines if the stimulus was threatening and produces a fear response accordingly. This is when "emotion" occurs.
Then, the hypothalamus translates this raw emotion, derived from sensory intake by the amygdala, into motivation for a specific action.
Everything up to this point has happened subconsciously and the signal can be viewed as "instinct", before it has been refined by higher though. What separates humans from less sophisticated animals is that this motivational impulse then must pass through the cerebrum, which is the home of conscious thought and inhibition.
The cerebrum, or cerebral cortex, is the part of our brain that is physically absent or significantly less evolved in the brains of other animals. It's the part of our brain that looks like a noodle, and it allows us to evaluate our instincts and when necessary edit them to fit our present needs.
For example, in order to feed ourselves, we have to drive to the grocery store, pick out food, pay another human being for it, and have the money necessary to do so in the first place.
However, for the overwhelming majority (~98%) of human history, feeding ourselves and our families involved going into the wilderness, killing another animal, and preparing it ourselves.
The presence of a cerebrum, and therefore of higher thought, allowed humans to realize that it is better to go to a grocery store than to go kill another living thing, and it also allowed us to act on that reasonable thought and create a system where a grocery store can exist.
How is the ECS (endocannabinoid system) involved?
This has been an extremely simplified version of how thinking works, and there is immensely more information that we do not know about this process than what we do know. However, research in the past several years has led to a new understanding of the involvement of the ECS in the processes of learning and memory. It is widely known that endocannabinoids are retrograde signallers, meaning that if a signal passes from neuron A to neuron B, then neuron B will release endocannabinoids that go back and bind with neuron A and tell it to either continue firing or to cease firing. Obviously, this will have a different effect on neurons with different functions.
In the hippocampus, this process is involved with regulating the frequency of firing, and we know that a high frequency of the same neurons communicating with each other is heavily involved in solidification of both abstract concepts and spatial arrangements.
If a stimuli, such as a delicious meal, is pleasing or rewarding, then hippocampal neuron B will release endocannabinoids telling hippocampal neuron A to keep firing, which increases the amount of receptors on neuron B, increasing its sensitivity to signals coming from neuron A, and the cycle perpetuates itself with the net result of a strengthened connection between the two neurons.
This strengthened connection means that your cerebrum will produce behaviors that lead you back to that positive stimuli, such as returning to the restaurant where you ate the delicious meal.