Suppose you buy a house. The house costs $100,000. You pay $100,000 cash for the house, wait a year, and then sell the house for $105,000. You've made a profit of $5,000 on an investment of $100,000, a respectable 5% rate of return. Suppose after a year you sell the house for $95,000: you've lost $5,000, or a -5% rate of return; painful, but not catastrophic.
Suppose, however, that you make a $5,000 down payment, and borrow $95,000 at 1% interest. If you sell the house at $105,000, you've made $5,000 on an investment of $5,950 (down payment + interest), for an 81% rate of return. If the house falls $5,000 in price, you're going to lose everything for a -100% rate of return.
In this case, borrowing money to buy the house constitutes leverage: it magnifies your rate of return, positive and negative, just as a physical lever magnifies force. A physical lever doesn't give you a "free lunch", in addition to magnifying the force applied, it also magnifies the distance you have to move your end of the lever; financial leverage magnifies not only the rate of return but also magnifies the risk.
Suppose you believe that overall, house prices are going to rise 5% in a year. Unfortunately, there's a lot of variation in individual house prices. Some houses will rise 10% in price; others, for various reasons (leaky roof, termites, a city council scandal) will fall 5% in price. Suppose you know (by looking at historical data) the probability distribution of these variations around a mean 5% increase. Since you know the distribution, this probability constitutes risk. If you have $100,000 to invest, you're better off buying 16-17 houses using leverage than you would if you bought one house for cash.
For example, suppose you know that there's a 67% chance of a house rising 10% in value and a 33% chance it'll fall 5% in value. If you buy one house for $100,000, your expectation is 67% * $10,000 + 33% * -$5,000 = $5,000. But you still have a 1/3 chance of losing 5,000. If you buy two houses, though, and the probabilities are independent (just because one house has termites doesn't mean another will), then your overall expectation doesn't change (you still expect to make $5,000 per house, an 81% rate of return), but the risk of losing your shirt falls to 11%. (The probability of a 10% rise (a 168% rate of return) also falls from 67% to 44%.)
The more houses you buy, the narrower the probability distribution, and the more likely it is you yourself will receive exactly the mean increase in house prices (less interest) and the leveraged rate of return on your investment. You're getting an 81% with (apparently) virtually no risk at all.
The bank doesn't mind loaning you all the money you want at a measly 1%, so long as you can come up with the down payment and interest: If worst case a house loses 5% of value, they'll get all their money back; they'll make their $950 rain or shine.
However, you're not the only smart person in the world. All your neighbors in Grosse Pointe or Beverly Hills also have $100,000 sitting in the bank earning 0.5% interest, and they'd also like to earn a hundred times as much by leveraged speculation in housing prices. You and all your neighbors start investing in houses. Assuming for the moment that the bank has infinite reserves and there's no effect from all these people withdrawing their savings to pay down payments to the owners (more on this later), you suddenly have a lot of people competing to buy houses, and the supply of houses can't quickly increase. So the efforts of all of these people to invest in houses will drive up the price of housing. But that's precisely what everyone is betting on! It's a "good" thing that I suddenly have to pay $101,000 for a $100,000 house, because the next guy will have to pay $102,000, and so on. All of this speculation makes the mean rate of return increase from a "fundamental" level of 5% to 6% or 7%, and raises the "worst case" from a loss of 5% to a loss of only 3-4%. Since the worst case has gotten less worse, we need a smaller down payment to buy a house, and we can further increase our leverage, increasing our rate of return.
If speculation is raising the fundamental rate of increase by just 1 percentage point, then house prices are 4.85% above their fundamental value after 5 years. Ruh roh, Shaggy! Remember, we're assuming that a "worst case" fall in price of 5% is uncorrelated between houses. But the speculation has created a correlated uncertainty: if everyone stops speculating, house prices will plausibly fall to their fundamental value, which would represent an almost 5% loss. Furthermore, because we have been building more houses than we otherwise would have, the fundamental price might rise less than 5%.
Suppose prices do fall 5% overall. Remember, the bank wants to be sure they get their principal back: They're not going to take much risk for a measly 1% interest rate. They're going to demand that borrowers fork over additional money for equity to cover the loss or sell the house and repay the loan immediately. Suddenly, you have a lot of speculators trying to sell a lot of houses, creating a temporary surplus, which lowers the price. Which makes the banks demand more equity and call in more loans, which lowers the price. Which... well, you get the picture. Since there's a huge temporary surplus, prices might fall below even their fundamental rate.
In a regulated capitalist economy, this "bubble" behavior isn't too bad. The banks, with their low interest rates and low tolerance for risk, act to dampen price swings: they make sure that investors, who took a higher risk for a higher return, eat the downside when prices fall.
The problem is that in an unregulated capitalist economy, the banks themselves are not content with a minuscule 0.5% return (the difference between what they pay to savers and what they collect from borrowers). They want in on these 81% rates of return too.