That like how startbucks UK pays it's company in a different country a fee for using it's brand, and therefore has no profits in Uk and pays no tax here
The law says that the fees paid for IP in this way have to be plausible. Franchising is a long-established business model and nobody would run a franchise if the franchise fee ate all the profit. So Starbucks' franchise fees are not plausible. Why doesn't HMRC challenge this? I've no idea.
Totally legit