system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How are allergies able to be acquired as people get older?

I've have friends who have just started to be allergic to some foods that they weren't allergic to before. How does this happen?
gpt
Allergies are caused by our immune system mistaking food or innocuous particles like pollen, for invading pathogens. 

How does this happen? Well, all cells and viruses have chemical markers on their surfaces call Antigens. Our own cells can recognize each other by reading their antigens, and our immune cells are the same. When an immune cell encounters another object, it will read its antigens, and if it doesn't recognize them as friendly, it will attempt to destroy the object. 

The immune system is also adaptable, and it has a memory. When we get chicken pox for example, after defeating it, the system will keep a record of the chicken pox antigens, so when the disease is encountered later on in life, our immune system already knows how to fight it.

Things that cause allergies also have antigens, and sometimes our immune system will encounter an antigen on some food, and mistakenly think its an invading pathogen. The immune system then mobilizes, attacks the foodstuff, and then keeps a record of its antigens. When the food is next encountered, the immune system will recognize it, and unleash its power to attack the food. The side effects of this battle is what we know as an allergy. 

Because our immune system can make a mistake at any point in our life, we always retain the chances of developing new allergies.