Yup, this is how collective security system works. It is far from perfect, but it managed to keep the World in more or less peace for pretty long time. We had wars, sometimes bloody, but still local once.
The corner stone of this system is nuclear weapons nonproliferation. This is, on one hand, unjust - why Australia cannot have its own nuclear arsenal and not be dependent on USA to give them protection? But on the other hand, though, think what would happen if we didn't have proliferation and every second African country had nukes (e.g. Yemen Houthis, Iran, Syria, Sudan, Algeria, etc.).
How Algeria would resolve, say, Algerian-Spanish their territorial dispute if Algeria had nukes and Spain did not?
This system is certainly not perfect, but it worked, we'll see if it will work in future.