Immune cells produce a cytokine, which prevents macrophages from generating inflammation that inhibit a protein important for learning/memory.
www.the-scientist.com
The IL-4 also prevents macrophages from releasing pro-inflammatory cytokines during stress that inhibits brain-derived neurotrophic factor (BDNF), which supports learning and memory. The disruption of BDNF during periods of stress disrupt the ability to learn and form memories. In other words, the IL-4 helps with learning under stressful situations.