The surprising link between war, the stock market, and government spending