The immune system is the set of tissues which work together to resist infections. The immune mechanisms help an organism identify a pathogen, and neutralize its threat.

The immune system can detect and identify many different kinds of disease agents. Examples are viruses, bacteria and parasites. The immune system can detect a difference between the body's own healthy cells or tissues, and 'foreign' cells. Detecting an unhealthy intruder is complicated, because intruders can evolve and adapt so that the immune system will no longer detect them.

Once a foreign cell or protein is detected, the immune system creates antibodies to fight the intruders, and sends special cells ('phagocytes') to eat them up.

Innate immune system 
Even simple unicellular organisms such as bacteria possess enzyme systems that protect against viral infections. Other basic immune mechanisms appeared in ancient life forms and remain in their modern descendants, such as plants and insects. These mechanisms include antimicrobial peptides (called defensins), phagocytosis, and the complement system. These make up the innate immune system, which defends the host from infections in a non-specific way. The simplest innate system is the cell wall or barrier on the outside to stop intruders getting in. For example, skin stops most outside bacteria getting in.

Human Innate Immune System Response

Our innate immune system responds very fast to anything foreign that enters our body. When something gets past our skin, like through a cut, our immune cells work to find the intruder and to alert each other of the foreign object. Small immune cells bring other cells from all over the body to the site where the foreign object was found. Other immune cells can send out messengers to cells nearby to have them help attack the foreign object. This process can make our skin look red and feel hot. A certain type of cell called a phagocyte eats anything foreign or dangerous that enters your body. This response is called non-specific because it responds the same way to anything foreign that enters your body from germs to a piece of dust.

Adaptive immune system 
Vertebrates, including humans, have much more sophisticated defense mechanisms.  The innate immune system is found in all metazoa, but the adaptive immune system is only found in vertebrates.

The adaptive immune response gives the vertebrate immune system the ability to recognize and remember specific pathogens. The system mounts stronger attacks each time the pathogen is encountered.  It is adaptive, because the body's immune system prepares itself for future challenges.

The typical vertebrate immune system consists of many types of proteins, cells, organs, and tissues that interact in a complex and ever-changing network. This acquired immunity creates a kind of "immunological memory".

The process of acquired immunity is the basis of vaccination. Primary response can take 2 days to 2 weeks to develop. After the body gains immunity towards a certain pathogen, if infection by that pathogen occurs again, the immune response is called the secondary response.

Autoimmune disorders 
In some organisms, the immune system has its own problems within itself, called disorders. These result in other diseases, including autoimmune diseases, inflammatory diseases and possibly even cancer. Immunodeficiency diseases occur when the immune system is less active than normal. Immunodeficiency can either be the result of a genetic (inherited) disease, or an infection, such as the acquired immune deficiency syndrome (AIDS), that is caused by the retrovirus HIV, or other causes.

In contrast, autoimmune diseases result from an immune system that attacks normal tissues as if they were foreign organisms. Common autoimmune diseases include Hashimoto's thyroiditis, rheumatoid arthritis, Type 1 diabetes, and Lupus erythematosus.

Immunology is the study of all aspects of the immune system. It is very important to health and diseases.

History of immunology 
Immunology is  scientific part of medicine that studies the causes of immunity to disease.  For many centuries people have noticed that those who recover from some infectious  diseases do not get that illness a second time.

In the 18th century, Pierre Louis Maupertuis made experiments with scorpion venom and saw that certain dogs and mice were immune to this venom. This and other observations of acquired immunity led to Louis Pasteur (1822–1895) developing vaccination and the germ theory of disease. Pasteur's theory was in direct opposition to contemporary theories of disease, such as the miasma theory. It was not until the proofs Robert Koch (1843–1910) published in 1891 (for which he was awarded a Nobel Prize in 1905) that microorganisms were confirmed as the cause of infectious disease. Viruses were confirmed as human pathogens in 1901, when the yellow fever virus was discovered by Walter Reed (1851–1902).

Immunology made a great advance towards the end of the 19th century, through rapid developments, in the study of humoral immunity and cellular immunity. Particularly important was the work of Paul Ehrlich (1854–1915), who proposed the side-chain theory to explain the specificity of the antigen-antibody reaction. The Nobel Prize for 1908 was jointly awarded to Ehrlich and the founder of cellular immunology, Ilya Mechnikov (1845–1916).

Evolution 
The immune system is extremely ancient, and may go back to single-celled eukaryotes which needed to distinguish between what was food and what was part of themselves.

"Genomic analysis of plants and animals provides evidence that a sophisticated mechanism of host defense was in existence by the time the ancestors of plants and animals diverged. This system, shared by plants and animals, is the Toll pathway of NFκB activation of gene function... The necessary DNA sequences are found in invertebrates, vertebrates, and plants".

References

Related page
Allergy
Immunity (medical)
Macrophage