The immune system is very complex.
There are many ways it can be affected to enhance or reduce its responses to particular antigens.
It has a lot of moving parts.
In addition to to what has been mentioned above here are some examples:
• Research Techniques: As part of my thesis project, I made monoclonal antibodies and did several different immune system manipulations. One was what I called a "negative immunization". After injecting the mice with a mixed set of antigens (mushed-up fish embryos) which activated a bunch of immune cells that could bind some antigen in the mix, I injected them with
cyclophosphamide (which kills responding cells), and then injected the mice with more antigen mix (activating cells that were not responding in the first round. This leads to antibody production against less common antigens in the antigen mix and eliminates responders to the most common antigens.
• Natural Selection: When the
Black Death plague killed off about 1/3 of the population of Europe, it resulted in
changes in their genetics, and presumably removed from the breeding population those whose immune systems were most susceptible to that disease. This is an extreme example of natural selection shaping a population's immune system to respond to big environmental challenges.
• Human Genetics:
Here is a list of genetically inherited human immune deficiencies.