Treaties do both.
If we never signed treaties, we would still be fighting a lot of battles that should have concluded a long time ago. If we don't have a treaty that defines our 200 mile exclusive economic zone, then we would have to send a gunboat out whenever another country wanted to challenge it. With a treaty this should hopefully be less frequent. Without a treaty other countries could claim arbitrarily large areas of the sea and the sea floor around their borders and we would have to fight over this too.
Wake up. Nobody is sending out gunboats to protect our 200 mile limit. There is no problem to be solved; and the lies pretending there is one reveal this to be yet another scam to promote world government and destroy our Free Republic, or what’s left of it.
And if treaties prevented armed struggles, WWII would never have happened—remember the Nazi-Soviet nonaggression pact?