The immune system is a complicated series of protein types, organs, cells, and tissue, all interacting in a complex and elaborate way. The function of your horse's immune system is to protect it from viruses, bacteria, parasites and any other foreign organism or material that may compromise it's health.
When a horse's immune system is weakened, it becomes more susceptible to illness. The bone marrow doesn't produce enough white blood cells to combat invading organisms and the lymph nodes don't produce enough phagocytes (cells that remove bacteria and cancerous cells in the bloodstream). The result is that the horse becomes infected by viruses or bacteria that exist in the environment.
Horse that suffer from allergic reactions are a good example of a hyperactive immune system that is overreacting to the pollen, dust or other allergens in the horse's atmosphere.