Blood is classified into different blood types called A, B, AB, and O.
Your immune system can usually tell its own blood cells from blood cells from those of another person. If other blood cells enter your body, your immune system may already have antibodies against them. These antibodies will work to destroy the blood cells that your immune system does not recognize.
Another way blood cells may be classified is by Rh factors. People who have Rh factors in their blood are called "Rh positive." People without these factors are called "Rh negative." Rh negative people form antibodies against Rh factor if they receive Rh positive blood.
There are also other factors to identify blood cells, in addition to ABO and Rh.
Blood that you receive in a transfusion must be compatible with your own blood. This means that your body does not have antibodies against the blood you receive.
Most of the time, blood transfusion between compatible groups (such as O+ to O+) does not cause a problem. Blood transfusion between incompatible groups (such as A+ to O-) causes an immune response. This can lead to a serious transfusion reaction. The immune system attacks the donated blood cells, causing them to burst.
Today, all blood is carefully screened. Transfusion reactions very rare.