(This is a core article that I will add to an amend with references and examples)
In order for trade to occur there has to be an exchange of goods or a transfer of money for goods. If an importer doesn’t have goods or cash to exchange, it has to borrow. When an importing country buys more than it sells, it creates a balance of payments deficit, which must be covered by borrowing.
Arms sales cause big shifts in foreign exchange. The seller gains foreign exchange, the buyer pays foreign exchange.
Countries like the USA have chosen to import large amount of oil because domestic consumption far exceeds supply. It gets this oil by selling, among other thing, military arms. (reference) Here’s a reference I haven’t checked but will try to: (Michael Klare, American Arms Supermarket (Austin: University of Texas Press, 1984). Another: Michael Klare, The Political Economy of Arms Sales, America-Saudi Arabia (New York: Springer)
In an article in Slate Magazine, Fred Kaplan points out that after US balance of payments turned negative during the Nixon administration in the 1970’s, State Department and Pentagon officials started to justify almost all potential arms exports on the basis of redressing the balance of payments problem. Slate Magazine, 30 March, 1970