What causes allergy?

Immune reaction. Your immune system normally makes igg antibodies that recognize foreign proteins. In patients with allergy, the immune system switches to making a ige antibodies for certain proteins. The ige antibodies act as a detector of the specific protein that they are made to react with and trigger the allergic response when they come in contact with that protein.
Genes/environment. When genes and the environment interacts, susceptible people develop diseases including allergic ones. Some environmental exposure such as being raised in a farm environment may reduce the risk in developing allergic diseases, others such as living in a humid indoor environment may enhance it.