Countries' external debt

Could someone please explain to me in simple words and examples, how come every country has external debt? How come a country instead of covering its own debt, buys another's debt? If you look at the link, every country owns to somebody.