Human blood types most likely came to exist to fend off infectious diseases. The reason individual humans have different blood types is that they inherit the trait of their blood having certain antigens on the outside of the blood cells from their parents. Antigens are molecules that trigger an immune response.
Not all human blood types have always existed. In fact, they developed over time because of genetic changes and mutations. It's thought that type A is the oldest type of blood, which then mutated into type B about 3.5 million years ago. About a million years later, type O developed. Some people also have type AB blood, which has both A and B antigens.
Red blood cells can have A or B antigens, or both A and B antigens, or neither. Blood with A antigens alone is classified as type A, while blood with only B antigens is type B. Blood with both A and B antigens is classified as type AB, and blood with neither antigen is type O. Type O blood is known as the "universal donor" and Type AB blood is likewise called the "universal recipient".