> Since 1945, developments in international law such as the United Nations Charter, which prohibits both the threat and the use of force in international conflicts, have made declarations of war largely obsolete in international relations
So since then, wars are now called "counter-terrorist operations", "peace enforcement operations", "special military operations" — you name it.
Nobody "declares war" anymore. See, for a defensive war (when a nation is being attacked) there is no legal need to declare it in the first place — and this is why Ukraine does not "declare war on Russia", and this is why Israel does not declare war against Hezbollah (and Hezbollah is not even a state to begin with) — it is a defensive war from the legal standpoint.
You declare an offensive war. And this is illegal. Once you do it, there will be legal repercussions, like troubles with purchasing weapons from other countries (as they often have laws prohibiting from selling weapons to countries at war). So why would anybody do it? It would be silly.