system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does the human body suddenly become allergic to a certain type of food, after years of eating it without any problems?

A relative of mine used to eat shrimps, crabs etc. almost weekly for years. Now he's suddenly allergic to that type of food and can't eat anything related to that without suffering from allergic reactions.

Why and how does this happen?
gpt
I was hoping you'd include shrimp in the question.  Shellfish are somewhat of a special case.  They're basically living filters, and they soak up the animals and chemicals around them.  There are very few people with a genuine allergy to shellfish; rather, they're allergic to what the shellfish have been eating.  

This is why you might eat shrimp for 30 years and suddenly blow up like a balloon, out of the blue.  Chances are good that if he ate shrimp from a different location, he would be just fine.  However, once you experience a negative reaction to a food, it's very easy to get caught up in the psychological response associated with getting sick.  He probably has no interest in eating shrimp at this point and would manage to feel genuinely sick even if he isn't really allergic.