The shares of producers of weapons, missiles, rockets, fighter jets, ships, tanks, drones and all sorts of military equipment are considered a good investment in times of economic uncertainty. Even though they do not provide staggering profits, usually they are a constant source of income, since government expenses (mainly the U.S.) remain relatively constant.
When, however, there are geopolitical tensions and wars, the shares of defence companies become very attractive. Then, government defence expenses soar and the orders for all sorts of weapons are literally pouring in. And this is quite logical.