What is a B cell?

B cells (aka B lymphocytes) are one of many types of cells in the immune system. There are many millions of them spread throughout the body. They are the only cells in the body that produce factors called antibodies (aka immunoglobulins) that do many important things. People with too few B cells or the antibodies they produce can have trouble defending against common microbes (viruses, bacteria, etc) and may get very serious and life-threatening infections.

Antibodies can bind to proteins and other biomolecules that are floating around in the body or that are attached to other cells. When each B cell develops, it makes a series of changes to its genetic code that end up producing an antibody with a random binding specificity. This makes every new B cell likely to recognize something different than every other B cell in the body. 

That's important because it leads to the total population of B cells being able to recognize almost any kind of protein or biomolecule in the world, including those that are on dangerous microbes that the person has never been exposed to before. When a B cell finds something that it recognizes through its surface antibody (aka B cell receptor) it can start to become activated.  

If B cells get activated, they can divide to form daughter cells with the same specificity leading to increased number of them. They can also make other genetic changes that allow their antibodies to leave the cell and spread throughout the rest of the body. This is the basis of how most vaccines work. By activating B cells that are specific toward the proteins on the particular microbe or factor (flu virus, measles virus, tetanus toxin, etc) that is being targeted by the vaccine, the immune system gets more prepared to recognize and eliminate those microbes and factors.