When a person receives a kidney through transplant there is a real chance the patient won't accept the kidney. The person's body receiving the kidney might have an immune response that attacks the new kidney. This is called rejection. The doctors will prescribe a series of drugs to help stop rejection, but that sometimes may be ineffective. Even the complicated process to match donors to patients sometimes doesn't help.
The holy grail of organ transplant technology may be realized using stem cell research. With stem cells it's possible a person would essentially receive a kidney made from their own body. A kidney made from your own body would be considered a perfect fit. There may be a day when kidneys are transplanted with almost no rejection.