The B cell receptor is what makes a B cell a B cell. It's main component is the immunoglobulin molecule that it is programmed to make. It's like a label on the surface of the cell that says, "This is what I make."
Back in the 1960s I though that antibodies were made to order, formed around the template of antigen. I well remember the lecture by John Verrier Jones who scotched this idea. He started by explaining how diverse was the immune response. Millions of different antibodies were requred. Yet it was improbably specific. A slight change in shape would mean that the antibody would no longer react with the antigen. Surely every antibody must be made individually; built to the specifications of the antigen.
But No. This is not how nature works. The usual method is to make every possible shape and select from these. Survival of the fittest is standard practice. The objection is that to produce every possible antibody requires more information than is present in the DNA. As John put it, "The information required would take up 44 chromosomes with only 2 left for all the other things the body needs to do."
The answer is mix and match. In the human there are 5 genes that code for the buiness end of the antibody - the end that combines with the antigen. The antibody molecule consists of 4 polypeptide chains (that means 4 chains made up of a sequence of amino acids). There are 2 identical light chains and 2 identical heavy chains. For the heavy chains the chains are Variable (VH) Joining (JH) and Diversity (D), while for the light chain there are Variable (VL) and Joining (JL). In order to obtain variation the chromosomes contain many different copies of these genes, all slightly different. So there are 51 different VH genes, 6 different JH genes and 27 different D genes. Something similar exists for the lightchain. Every time a new lymphocyte is born it selects one of the 51 VH genes, one of the 6 JH genes and one of the 27 D genes. Thus it decides to use only one of the 8262 possible combinations.
It is even more complicated than that. The junction between V and D and D and J is imprecise. It is like my carpentry. When I make a joint, sometimes there is a gap and I have to add filler to fill it; sometimes the fit is too tight and I have to plane a bit off to make the fit. The same is true with the immunoiglobulin genes sometimes the cellneedes to add filler, sometimes to plane a bit off.
To explain how this works we have to understand the DNA code.
DNA is like a spiral staircase. The bannisters are made up from the sugar backbone; the steps from the nucleotide bases. In DNA there are 4 types of nucleotide: Guanine (G), Thymidine (T), Cytosine (C) and Adenine (A). In forming the steps C always pairs with G and A always pairs with T. This makes copying easy because if the two halves of the chain come apart as they do in cell division, each acts as a template for the construction of the complementary chain.
The DNA is translated into protein, which is made up of chains of amino acids. In the DNA a sequence of three nucleotides is called a triplet. There are 64 possible triplets and 20 possible amino acids. Some amino acids are coded for by 4 triplets and some by 2, while one triplet codes for 'start copying' and one for 'stop copying'. Thus GCU codes for alanine, AGC for serine, UGC for cystine, GAC for aspartic acid, CUG for leucine, AUG for methionine etc. When extra filler nucleotides are added it changes the whole sequence.
For example, imagine a sequence of alanines:
GCU GCU GCU GCU GCU GCU GCU
ala ala ala ala ala ala ala
An extra nucleotide insertion does this:
GCU GCU AGC UGC UGC UGC UGC
ala ala ser cys cys cys cys
Removing a nucleotide does this:
GCU GCU GCU CUG CUG CUG CUG
ala ala ala leu leu leu leu
These are called frame shifts: obviously any sequence of nucleotides can be read in any of 3 frames. It means that the number of possibles is now multiplied by 3 up to over 24,000, plus the extra nucleotides are not limited to one or two but may be many: it could be very bad carpentry.
When the light chain possibilities are added in we are up into the millions.
There is even more refinement to come. The usual thing is for antigen to select out the BCR that fits it best and to take it along to the nearest germinal center where antigen and antibody start canoodling. The B cell reacts by dividing and each time it does so it makes a subtle variation in the BCR by a small number of point mutations. These are called somatic mutations. Some of these will make the antibody a dreadful fit for the antigen: such cells are executed by apoptosis. But some will be a better fit, and by such selective breeding the dog with just the right length of tail is produced. Thus the best antibody for any immune response is made.