Once it was about trade routes and mutual defense pacts - today it is more about politics and protecting economies. It makes sense for powerful companies to protect less able, if it allows for them to maintain or better their economic position. Some countries were banned from protecting themselves due to bad behavior in the past - post war Germany and Japan spring to mind, and littkle option but accept defense from other powers.
It can seem very callous though - we see Kuwait drilling under Iraqi borders and stealing oil, warned and eventually invaded - and the world jumps to their aid - yet we see Rwandans slaughtering each other with abandon in a monstrous fit of ethnic cleansing and so on, with the world turning their backs. Pacts are predicated on "what's in it for me" - so a country is either in number one spot with super high arms spending (like USA/China/and Europe and Russia to a much lesser extent), or giving away the family jewels to be worth protecting.