Why the ISA wrapper disappears under Spanish tax
UK ISAs work because UK tax law explicitly exempts income and gains inside the wrapper. The wrapper itself doesn't do anything magical — it's a tax fiction that depends on UK law granting the exemption.
Spanish tax law has no concept of an ISA. Spain looks through the wrapper at the underlying investments and taxes them as if you held them directly. UK gilts inside an ISA are treated as UK gilts. UK equity inside a Stocks & Shares ISA is treated as UK equity. The fact that they sit inside an ISA is irrelevant.