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 another person. If other blood cells enter your body, your immune system may make 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. Being compatible means that your body will not form antibodies against the blood you receive.
Blood transfusion between compatible groups (such as O+ to O+) usually causes no problem. Blood transfusion between incompatible groups (such as A+ to O-) causes an immune response. This can lead to a very serious transfusion reaction. The immune system attacks the donated blood cells, causing them to burst.
Today, all blood is carefully screened. Modern lab methods and many checks have helped make these transfusion reactions very rare.