The Prime Minister has pledged to increase defence spending to 2.5% by 2027 and to 3% by the next Parliament.