The brain appears to be necessary in regulation of some bodily processes. But not all. Some animals and most plants have no brain, and most plants have no nervous system at all, yet they exhibit some behaviors that we associate with the brain, including learning. Plants can have conditioned response and anticipate, slowly, of course. The idea is that the nervous system and the brain accelerate such behavioral responses, but do not originate all of them.