There's a very interesting chapter on why larger powers no longer go to war in industrialized societies in this game review https://acoup.blog/2021/08/20/collections-teaching-paradox-v... (don't let yourself be fooled by the fact it pretends to be a game review, it's a history lessen in disguise)

TL;DR: It no longer pays off. Before the industrialization, the way to improve your countries productivity was to acquire more land, more people, more resources - annex your neighbor. After the industrialization, that is no longer true. Any war against a power that is roughly approaching your power is likely to be net negative: You'll loose more of your economical improvements than you'll gain by annexing lands that are probably destroyed by war. It's what makes guerrilla warfare so powerful. The author also convincingly argues that the first and second world war were a product of people still stuck in the old, per-industrialization mindset while the economics and destructive power of post-industrialization applied.

(very selective) Quote:

Historically speaking, there is actually something to this. As Azar Gat notes in War in Human Civilization (2006), for most of human history, war ‘paid,’ at least for the elites who made decisions. In pre-industrial societies, returns to capital investment were very low. ( ...) For antiquity, the Roman Empire (...) one estimate, by Richard Saller, puts the total gains per capita at perhaps 25% over three centuries.

But returns to violent land acquisition were very, very high. In those same three centuries, the Romans probably increased the productive capacity of their empire by conquest 1,200% (...). Consequently, the ‘returns to warfare’ – if you won – were much higher than returns to peace. The largest and most prosperous states tended to become the largest and most prosperous states through lots of warfare and they tended to stay that way through even more of it.

As Gat notes, the industrial revolution changed this, breaking the agricultural energy economy. Suddenly it was possible, with steam power and machines, (...) to do work (...) – for the first time, societies could radically increase the amount of energy they could dispose of without expanding. Consequently – as we’ve seen – returns to infrastructure and other capital development suddenly became much higher. At the same time, these new industrial technologies made warfare much more destructive (...). Those armies were so destructive, they tended to destroy the sort of now-very-valuable mechanical infrastructure of these new industrial economies; they made the land they acquired less valuable by acquiring it. So even as what we might term ‘returns to capital’ were going wildly up, the costs of war were also increasing, which mean that ‘returns to warfare’ were going down for the first time in history.

It’s not clear exactly where the two lines cross, but it seems abundantly clear that for the most developed economies, this happened sometime before 1914 because it is almost impossible to argue that anything that could have possibly been won in the First World War could have ever – even on the cynical terms of the competitive militarism of the pre-industrial world – been worth the expenditure in blood and treasure.