Sir Keir Starmer unexpectedly announced UK defence spending would rise to 2.5% of GDP by 2027, funded by a cut to foreign aid.