Rejection primarily occurs when the immune system identifies the transplanted organ as a foreign object and mounts an attack against it. This response can be triggered by several factors, including genetic differences between the donor and recipient, insufficient immunosuppressive therapy, or infections.