A lifetime donation or a bequest by will to a charity is exempt from IHT. A charity may prefer to receive a lifetime donation under Gift Aid because it can reclaim basic rate tax on the gift made.
See IHT: Lifetime charitable giving for a worked example.