International trade can be a profitable enterprise but many rich countries buy far more (in terms of €£$) than they produce thanks to the demands of consumers for highly finished, expensive goods which are produced cheaply in economies with lower costs (lower wage rates, lower cost of raw materials, lower production costs, lower operational costs etc).
A governments main account details the interaction between what it buys and what is sells. This is known as the balance of payments. This details all the financial flows (credit and money) between a country and its trading partners.
Heres the PDF PIIGSty Econ 101 #31 BOPs