In the general sense processing of such learned behavior happens in the bacteria, the rodent and in humans. The processing in bacteria is simpler than the rodent. The rodents processing is simpler than the humans. But they all occur using chemical processes.
So if we can extend the courtesy of imagination to rodents why not extend it to bacteria as well?