Hank Green, from SciShow, explains how the researchers were able to take the heart of a pig and insert it into a baboon. For this to work they needed to also engineer the heart to not generate certain proteins that are strangers to the human body.
The issue with 15% of the transplants is that the organ that is inserted into the receiving body is not accepted by the body based on markers that tell said body that they have encountered a foreign object. This is why the doctors need to prescribe imunosuppressors in such cases to make the body weaker in detecting foreign organs. this leads to other complications and thus the transplantee will have a weaker immune system.
This is why experiments like the baboon with two hearts are great, because the modified pig heart was accepted by the body for more than a year.
In the future genetics will work our how to completely use pig hearts, since they are similar to those of humans, as base for transplants and make the body also keep them. It all boils down to certain proteins the foreign tissues are creating. Ka-tching 😀
Check the description form the Youtube video for sources.