(CNN) -- The U.S. economy is clearly in terrible shape. What is less clear is how we got here.
An index of home prices in 20 major metropolitan areas fell at a record annual pace in November of 2008, according to a recent report.
Opinions vary on when and where to begin the story, but many experts trace the origins of the current economic situation to the housing bubble that came about earlier this decade.
Housing prices jumped at a rate above 6 percent in 1999 and increased rapidly and steadily as the decade turned, according to a recent study by the Brookings Institution.
"After the mid-1990s ... real house prices went on a sustained surge through 2005, making residential real estate not only a great investment, but it was also widely perceived as a very safe investment," the study said.
The prices eventually moved "out of line with fundamentals like household income" and the bubble formed, the study said. Read the complete Brookings study
There were two trends developing at that time that contributed to the housing bubble, experts said.
The Federal Reserve Board, to combat the recession of 2000-01 and the economic effects of the September 11 terrorist attacks, began drastically slashing interest rates.
Consequently, it was very easy to borrow money, especially if you wanted to buy a home.
Meanwhile, global investors -- flush with cash from the worldwide economic boom of the 1990s and '00s -- were looking to the U.S. economy to make even more money.
"You have a group of people growing richer by leaps and bounds," said Peter Rodriguez, an economist at the University of Virginia. "And they liked the idea of parking some cash in the biggest, safest economy in the world."
Enter mortgage-backed securities
Wall Street firms sought to connect the rich investors with the rapidly expanding housing market with the help of complicated financial instruments.
These instruments -- such as mortgage-backed securities we've heard so much about -- made it easier to move the investors' funds into the housing market, which fed the extraordinary price sprial, Rodriguez said.
"It began to really take on a life of its own when people saw how much money they could make in housing," he said. "Before long, everybody was pushing along the momentum of this train."
So how do these mortgage-backed securities work and what role did they play?
Let's say there are three prospective homebuyers in a neighborhood. A local bank makes mortgage loans to all three, then bundles up the mortgages and sells the bundle to a big Wall Street firm, like the now-bankrupt Lehman Brothers.
The Wall Street firm takes its bundles of mortgages and offers them to investors. The investors make money off the interest payments from the original borrowers.
These instruments helped minimize risk for the local bank because it was no longer responsible for the loans it made to the local homebuyers.
"You didn't even have to worry about a loan once you made it. You didn't have to keep it on your books," Rodriguez said. "The only limitation was how fast you could turn the loans."
It was an intoxicating era when you could make a lot of money quickly through the housing market, and you did it through the "basic idea of leverage," Rodriguez said.
He provided an example: You take out a mortgage loan for $100,000 and make a 20 percent down payment, which would equal $20,000.
If the price of the house goes up to $120,000, you've effectively doubled your money. If you sell at that price -- assuming there are no transaction costs -- you walk away with an extra $20,000.
Leverage works the same way for banks. They borrow from other banks or other institutions so that they can hand out more loans and make more money.
"This encourages all sorts of risky behavior by individuals looking to buy homes, and it encourages banks to lend because, in an environment where prices rise, they're making lots of money, too," Rodriguez said.
The housing collapse
Economists say not everyone can -- or should -- buy a home, but that didn't stop many homebuyers, banks or Wall Street firms during the housing bubble, when the only way for prices and profits was up.
Some banks and other institutions were even eager to lend money to prospective homebuyers with poor credit and a spotty financial history who would not typically qualify for loans.
These transactions are known as "subprime" mortgage loans. They generally have interest rates that are above "prime" interest rates available to borrowers with good credit.
On its face, there is nothing devious or illegal about a high interest "subprime" loan. Its simply a case of lender taking on a higher risk and receiving a higher interest rate in return.
However, nearly half of the loans made in 2006 were of the subprime variety, which increased the risk of borrowers defaulting on many banks' balance sheets.
"Prime mortgages dropped to 64 percent of the total in 2004, 56 percent in 2005 and 52 percent in 2006," the Brookings study notes.
Even so, many banks and brokerage firms continued bundling the mortgages, many of them bad loans, and Wall Street kept buying them and selling them to investors. And the people who could have put a brake on the increasing amount of risk -- the agencies that regulate the U.S. financial sector -- weren't paying attention.
"As long as everyone was paying their mortgage, that was fine," said Ali Velshi, CNN's chief business correspondent. "[But] we didn't take into account with these mortgages that people might lose their jobs, the interest rate might go up and the housing prices may go down.
"Guess what? All three happened."
Housing prices started trending downward, and by 2007 the bubble had burst.
"You're a homeowner or a bank, and you're trying to sell your property, but everything else on the block is for sale, too," Velshi said. "Everything collapsed like we've never seen before."
The credit crisis
Knee-deep in bad loans, many banks and lending institutions panicked. Many of them were over-leveraged, experts say; simply put, they had borrowed beyond what was responsible and were now on the hook.
Another way to understand it is that for every dollar a bank may have had in the vault, it had $10 to $25 floating in the market in loans, and a good bit of that money was tied up in bad loans.
The banks sought to decrease that ratio by either getting rid of the bad loans or raising more money, Rodriguez said.
The problem with dumping the loans on the market is that "it lowers the price, and anyone else who has them is suddenly in even worse shape," he said.
It was a "death spiral of prices," and it spread like a virus across the financial sector, from legendary Wall Street firms like Bear Stearns and Lehman Brothers to local and regional banks and brokerage firms across the country, Rodriguez said.
As stockholders found out about the bad loans these firms were carrying, they pulled their money out. The markets plummeted.
Meanwhile, paralyzed by their bad assets and looking to hoard cash, banks stopped lending. It didn't matter if you were an individual with good credit, a healthy business or another bank.
The American financial system was effectively frozen.
"It was a perfect storm," Velshi said. "It was a lack of regulation, it was greed and creativity in the financial industry, and it was an American dream that got off track."