Everyone’s heard of the A, B, AB and O blood types. When you get a blood transfusion, doctors have to make sure a donor’s blood type is compatible with the recipient’s blood, otherwise the recipient can die. The ABO blood group, as the blood types are collectively known, are ancient. Humans and all other apes share this trait, inheriting these blood types from a common ancestor at least 20 million years ago and maybe even earlier, claims a new study published online today in Proceedings of the National Academy of Sciences. But why humans and apes have these blood types is still a scientific mystery.

The ABO blood group was discovered in the first decade of the 1900s by Austrian physician Karl Landsteiner. Through a series of experiments, Landsteiner classified blood into the four well-known types. The “type” actually refers to the presence of a particular type of antigen sticking up from the surface of a red blood cell. An antigen is anything that elicits a response from an immune cell called an antibody. Antibodies latch onto foreign substances that enter the body, such as bacteria and viruses, and clump them together for removal by other parts of the immune system. The human body naturally makes antibodies that will attack certain types of red-blood-cell antigens. For example, people with type A blood have A antigens on their red blood cells and make antibodies that attack B antigens; people with type B blood have B antigens on their red blood cells and make antibodies that attack A antigens. So, type A people can’t donate their blood to type B people and vice versa. People who are type AB have both A and B antigens on their red blood cells and therefore don’t make any A or B antibodies while people who are type O have no A or B antigens and make both A and B antibodies. (This is hard to keep track of, so I hope the chart below helps!)

After Landsteiner determined the pattern of the ABO blood group, he realized blood types are inherited, and blood typing became one of the first ways to test paternity. Later, researchers learned ABO blood types are governed by a single gene that comes in three varieties: A, B and O. (People who are type AB inherit an A gene from one parent and a B gene from the other.)

More than a hundred years after Landsteiner’s Nobel Prize-winning work, scientists still have no idea what function these blood antigens serve. Clearly, people who are type O—the most common blood type—do just fine without them. What scientists have found in the last century, however, are some interesting associations between blood types and disease. In some infectious diseases, bacteria may closely resemble certain blood antigens, making it difficult for antibodies to detect the difference between foreign invaders and the body’s own blood. People who are type A, for instance, seem more susceptible to smallpox, while people who are type B appear more affected by some E. coli infections.

Over the last hundred years, scientists have also discovered that the ABO blood group is just one of more than 20 human blood groups. The Rh factor is another well known blood group, referring to the “positive” or “negative” in blood types, such as A-positive or B-negative. (The Rh refers to Rhesus macaques, which were used in early studies of the blood group.) People who are Rh-positive have Rh antigens on their red blood cells; people who are Rh-negative don’t and produce antibodies that will attack Rh antigens. The Rh blood group plays a role in the sometimes fatal blood disease erythroblastosis fetalis that can develop in newborns if an Rh-negative women gives birth to an Rh-positive baby and her antibodies attack her child.

Most people have never heard of the numerous other blood groups—such as the MN, Diego, Kidd and Kell—probably because they trigger smaller or less frequent immune reactions. And in some cases, like the MN blood group, humans don’t produce antibodies against the antigens. One “minor” blood type that does have medical significance is the Duffy blood group. Plasmodium vivax, one of the parasites that causes malaria, latches onto the Duffy antigen when it invades the body’s red blood cells. People who lack the Duffy antigens, therefore, tend to be immune to this form of malaria.

Although researchers have found these interesting associations between blood groups and disease, they still really don’t understand how and why such blood antigens evolved in the first place. These blood molecules stand as a reminder that we still have a lot to learn about human biology.