system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: during the economic crisis, a lot of countries went into several billions or even trillions of debt. But where did all that money go in the first place?

And I'm not talking specifically about the USA. But also about Greece, Spain, Italy and Portugal for example.
gpt
When governments are not able to raise enough tax revenue to pay for the things they want to buy (by which i mean, funding social programs, maintaining infrastructure, military spending, etc) they make up the difference by selling "bonds".  A bond is basically just an agreement between the government and the investor that in exchange for an investment of say, $10,000 today, the investor will get $10,500 next year (or whatever, the actual amounts aren't important yet).  What's important is that the more confidence investors have in your ability to make good on your promise, the more willing they will be to invest that money (the US government can sell bonds at incredibly low rates because it's considered to be such a safe investment).

So, what happened during the great recession, is that as their economies crashed, tax revenues crashed with them, and all of a sudden governments had to borrow tons and tons more money than they really wanted to, in order to pay their bills (you can't really just cancel national pensions or health care or whatever, every time the economy stumbles).  Unfortunately, some of them were forced to borrow *so much* money, that investors started to worry that they might never actually get paid back, and started to demand higher and higher interest rates on their bonds.  At a certain point, this becomes a bit like payday loans on a national scale, where you're trapped just forever borrowing and borrowing to make this week's payment.  Now, if a country controls its own currency, one way out of this mess would be to just let the currency inflate, which makes it easier to pay your debts (among many other effects), but this wasn't really an option for the Eurozone countries, because they couldn't control the Euro.  So, instead, they were forced into counterproductive "austerity" programs to cut spending in exchange for emergency loans from the rest of the eurozone.