Harmful invaders such as bacteria, viruses, fungi and parasites are collectively called pathogens. Invertebrates use relatively simple defense strategies that rely chiefly on protective barriers, toxic molecules, and phagocytic cells that ingest and destroy invading organisms. This is called the innate immune response. Vertebrates can also mount more sophisticated defenses, called adaptive immune response. The function of adaptive immune responses is to destroy invading pathogens and any toxic molecules they produce.
An antigen is any substance that elicits an immune response, from a virus to a sliver.
The immune system has a series of dual natures, the most important of which is self/non-self recognition. The others are: general/specific, natural/adaptive = innate/acquired, cell-mediated/humoral, active/passive, primary/secondary. Parts of the immune system are antigen-specific (they recognize and act against particular antigens), systemic (not confined to the initial infection site, but work throughout the body), and have memory (recognize and mount an even stronger attack to the same antigen the next time). 
Adaptive immune responses are carried out by white blood cells called lymphocytes. There are two broad categories of responses:
1. Humoral (antibody) responses: carried out by B cells
2. Cell-mediated immune responses: carried out by T cells
In humoral response, B cells are activated to secrete antibodies, which are proteins called immunoglobulins. Antibodies circulate and bind specifically to pathogens, thereby inactivating them. Binding also marks the pathogen for destruction by phagocytic cells of the innate immune system. The specific affinity of an antibody is not for the entire macromolecular antigen but for a particular site on the antigen called the epitope or antigenic determinant.
In cell-mediated immune responses, killer T cells kill cells that display foreign motifs on their surfaces. Helper T cells contribute to both humoral and cellular immune responses by stimulating the differentiation and proliferation of appropriate B cells and killer T cells.
The immune system links genes in a combinatorial manner to produce distinct protein-encoding genes not present in the genome.
Antibodies possess distinct antigen-binding and effector units
Antibodies are composed of antigen binding components Fab and Fc which does not bind antigen but is responsible for effector functions. The antibody IgG molecule consists of two kinds of polypeptide chains, light chain (L) and heavy chain (H). Each L chain is linked to an H chain by a disulfide bond, and the H chains are linked to each other by at least one disulfide bonds. The IgG molecule is shaped like an L where Fc is the stem. Segmental flexibility allows two antigen binding sites to adopt a range of orientations. One IgG molecule can bind to multiple antigens.
IgA - present in external secretions such as saliva
IgE - protection against parasites
Each of the five classes of immunoglobulins has the same light chain but a different heavy chain.
Complementarity determining loops (CDRs) are hypervariable loops present at the end of the structure. Variation of amino acid sequences of these loops provides major mechanism for the generation of vastly diverse set of antibodies. Combinatorial variation of the 3 VL and 3 VH enables construction of a very large number of binding sites.
Numerous hydrogen bonds, electrostatic interactions, and van der Waals forces, reinforced by hydrophobic interactions combine to give specific and strong binding.
Diversity is generating by gene rearrangements
We have seen that antibody specificity is determined by the amino acid sequences of the variable regions of both light and heavy chains. This variability is the result of immunoglobulin genes being rearranged in the differentiation of lymphocytes.
There are about 1012 lymphocytes and 108 distinct antibodies in a human body. Each lymphocyte is committed to respond to a specific antigen. Lymphocytes are required for adaptive immune system. Innate immune system relies on pattern recognition receptors. The antigens are either destroyed, delivered to lysosomes, attached to cell membranes to activate cell signal pathways, or delivered to a lymph node to initiate an adaptive immune response through contact with T cells. Once activated, T cells either migrate to the site of infection to help macrophages or stay behind to help B cells. Innate system is activated at the site of infection. Adaptive system is activated in perphiral lymphoid organs. Both innate and adaptive immune systems work together.
B lymphocytes develop in the bone marrow and T lymphocytes develop in the thymus. T and B cells become morphologically distinguishable only after they have been activated by the antigen. Killer T cells kill infected cells. Helper T cells help activate macrophages, B cells, and killer T cells. Upon activation, the adaptive immune system releases various lymphocytes which proliferate and differentiate selectively stimulated by antigen binding specificity.
Most antigens result in polyclonal responses, meaning that various antibodies with bind with different specificities are produced. In a monoclonal response, only one antibody is produced.
The adaptive immune system can remember prior experiences, thus providing lifelong immunity to common infectious diseases. The primary immune response occurs when the an animal is first exposed to an antigen. Secondary immune response occurs if the same antigen reappears after an extended period of time. This time the lag period is longer but the response is greater.
When naïve cells encounter an antigen cells for the first time, some of them are stimulated to proliferate and differentiate into effector cells which actively engage in making a response. Some naïve cells, however, become memory cells. Memory cells do not engage in a response but are induced into effector cells more easily. Upon a second encounter with the same antigen, the memory cells would either give rise to either effector cells or more memory cells. Memory cells can live for the lifetime of the organism.
 Molecular biology of the cell, 4th edition
 Biochemistry, 5th edition, by Stryer et al.