Any preferential spending in Scotland must be extended to the whole United Kingdom. Paid for by a reduction in the block grant to the Scottish devolved body.
That body has its own revenue-raising powers with which to make up the shortfall. Everyone's a winner. Easy.
And like the capping of energy prices, which is such a winner that Theresa May has adopted it.