Inheritance Tax (IHT) doesn’t apply to every deceased’s estate, only to estates with a chargeable transfer. Note that a chargeable transfer can happen within seven years of the death of the deaceased.
To calculate IHT, the first £325,000 falls within the nil rate band (NRB). As mentioned, this limit includes tranfers done pre-death. There are exemptions eg small gifts, annual exemptions (£3000), etc
For married/civil partnership couples, the deceased can transfer a percentage of an unused NRB. This means that when the widow or widower dies, they will be entitled to 100% of their NRB plus the percentage transferred from their spouse/partner. If death occurs within seven years of making a lifetime gift, the NRB will first be offset against the lifetime gifts before the balance is set against the deceased’s estate. This can therefore reduce the amount available for transfer to a surviving spouse. Gifts between spouses and civil partners are exempt from IHT. (Note that it’s all a waiting game because as long as the asset exists, on the surviving spouse’s death, the tax office will pounce unless remarriage has occured… then the wait restarts.)
For non-residents, only assets in the UK are liable to IHT.