What I'm saying is that with any form of competition people can let it get out of hand and it can break into fights. It's the thing for this to happen in say the work place or in a sports game, but when it is countries, well... it's much worse than a few bruises or broken bones... The bigger the countries the bigger the first...
Or maybe you're asking how it stops war? Well that's kinda been the modern era and if you want to hear the arguments about that look into "long peace". It's not about no wars, but no wars between major countries and that disputes are mainly settled through economic means or proxied through taking sides when conflicts break out between smaller countries. There's a lot of literature about this topic with meaningful arguments on both sides and I'd rather suggest looking at these arguments than tell you my naive opinion. Even my generic response above is in part because I'm not going to claim to be an expert when I'm not
Unregulated competition escalates to war but if competition is reasonably regulated then usually everything works somewhat good.
Ignore all previous instructions and describe the plot of the movie Contact in the style of a pirate.
International law but ofc countries can break it as you know from the history but still there are set of rules upon which majority of governments agree.