system
Given the following post, respond as if you're commenting on Reddit:
human
How can someone become algeric to something they were not previously allergic to?
gpt
One of the biggest points of the immune system is the ability to adapt to new threats. This is the whole reason vaccines work, that we can fight off diseases we haven't seen, and that there are a bunch of childhood diseases you never get again. The immune system is constantly monitoring the body for unfamiliar things showing up where they shouldn't. On the flip side, there are a bunch of checkpoints to make sure that the immune system isn't flagging parts of you as the enemy, which is important because the immune system has some pretty serious weapons to destroy stuff. 

The systems involved in figuring out friend vs. enemy are really complicated, but long story short, they're not perfect. Sometimes, harmless proteins in food get flagged as the enemy, even if you've had it before-- it's sort of a low-risk odds game each time you eat something. Generally speaking, the body is a lot more tolerant of stuff that shows up in the gut as "probably food," but very mad about unfamiliar stuff showing up in the blood as "probably enemy."