A credit default swap (or CDS for short) is a kind of investment where you pay someone so they will pay you if a certain company gives up on paying its bonds, or defaults. A credit default swap is like insurance on bonds, but different from insurance in important ways:

Insurance companies make sure you own the thing you're insuring, but you can buy credit default swaps for bonds you don't own.

The government makes rules (called regulations) for insurance, but they don't make any yet for credit default swaps.

Insurance companies have to have enough money in case lots of people need to collect insurance at the same time. Because there aren't many rules for CDS sellers, they don't have to be as careful.

Because nobody makes sure you have the bonds you get credit default swaps for, people can speculate on them by buying credit default swaps on companies they think will get in trouble.

When Lehman Brothers went bankrupt on September 15, 2008, it defaulted on its bonds. The insurance company AIG had sold lots of credit default swaps for Lehman, but they didn't have enough money to pay all the people they had sold them to.

This is because the way lots of companies speculated was by hedging on credit default swaps. They bought credit default swaps for a company, and then sold credit default swaps for the same company when the CDSes got more expensive. For example, if you bought some Lehman Brothers CDSes from AIG where you had to pay $500,000, and you sold the same number of CDSes on Lehman a year later for $600,000, you made $100,000 profit. If Lehman defaulted, you're supposed to pay the people you sold the CDSes to, but that should be OK because now AIG is supposed to pay you for the CDSes you bought.

So many companies bought and subsequently sold CDSes that when Lehman collapsed, no one had enough money to pay the people they sold the CDSes to. They tried getting it from the companies they'd bought CDSes from, but they didn't have enough money either. Those companies tried collecting from the companies that owed them money, but they didn't have enough either, and so on. Since AIG had sold so many of these, people were afraid that AIG would just give up on trying to pay them all. If they had done that, there would be a domino effect where everybody would go out of business. Because so many companies would've gone out of business, the government decided to help AIG pay so the economy wouldn't collapse.

When people found out that the Greek government owed more money than everybody thought it did, people who didn't own any Greek government bonds started buying credit default swaps on Greek bonds. They did that because they thought Greece would give up on trying to pay, so the bonds would become worthless and the people who sold the credit default swaps would pay them. Unfortunately, this makes people who have Greek bonds nervous, so they want to sell them and not buy any more. That makes it hard for Greece to borrow money to fix its money problems.