From the very first time that our body comes into contact with a foreign substance (antigen), the immune system learns how to recognise it and ‘memorises it’.
It then prepares its response by producing antibodies specifically designed to fight that particular antigen.
Thanks to its ‘memory’, every time this same antigen appears in the body, the immune system recognises it and rapidly responds.
This is why someone suffering from hayfever will react every time they come into contact with the specific type of pollen that has been memorised by their immune system.