Sometimes the immune system makes a mistake. One type of mistake is called autoimmunity: the immune system for some reason attacks your own body in the same way it would normally attack a germ. Two common diseases are caused by immune system mistakes. Juvenile-onset diabetes is caused by the immune system attacking and eliminating the cells in the pancreas that produce insulin. Rheumatoid arthritis is caused by the immune system attacking tissues inside the joints.
Allergies are another form of immune system error. For some reason, in people with allergies, the immune system strongly reacts to an allergen that should be ignored. The allergen might be a certain food, or a certain type of pollen, or a certain type of animal fur. For example, a person allergic to a certain pollen will get a runny nose, watery eyes, sneezing, etc. This reaction is caused primarily by mast cells in the nasal passages. In reaction to the pollen the mast cells release histamine. Histamine has the effect of causing inflammation, which allows fluid to flow from blood vessels. Histamine also causes itching. To eliminate these symptoms the drug of choice is, of course, an antihistamine.
The last example of an immune system mistake is the effect the immune system has on transplanted tissue. This really isn't a mistake, but it makes organ and tissue transplants nearly impossible. When the foreign tissue is placed inside your body, its cells do not contain the correct identification. Your immune system therefore attacks the tissue. The problem cannot be prevented, but can be diminished by carefully matching the tissue donor with the recipient and by using immunosuppressing drugs to try to prevent an immune system reaction. Of course, by suppressing the immune system these drugs open the patient to opportunistic infections.
For more information on the immune system and related topics, check out the links below.