As with any human interaction, international relations, whether economic or political, are a combination of cooperation and competition.
The "cooperation" part benefits all involved, whether by sustaining world peace or boosting growth and prosperity through free trade. The "competition" part creates serious risks, from economic impediments to war and environmental destruction. So why don't countries cooperate more?