It's learning in the same sense the immune system learns to fight of infections. The difference is that the mechanism by which cells record state is similar to one of the mechanisms also used by the brain at the cellular level, which you would expect.
The cells and structures that make up the brain evolved from simpler structures, so we would expect some reuse of mechanism.