A friend of mine recently tried to purchase a home in Northern California. He gave up after a year of trying. Few homes were available for sale, and those on the market were quickly snatched up by investors paying all cash.

This is becoming more common. In June, nearly 70% of for-sale homes received multiple offers, up from 50% two years ago, according to Redfin.

Nationwide home prices are up 12% from a year ago. Some regions have enjoyed 20% growth. This is way above what anyone should expect real estate to gain in the long run. And it's a product of one simple fact: The supply of homes for sale was recently at the lowest level since the housing bubble last decade.

In a healthy real estate market, enough homes will be on the market to supply about six months of sales activity. Earlier this year, supply dropped all the way to 3.9 months, or the lowest since 2004.

But things are changing. Supply is ramping up again, now running at 5.2 months' of sales:

Keep an eye on this. Rising supply almost certainly means growth in home prices will cool off. This should come as no surprise -- no one should have expected prices to keep growing at more than 10% per year.

The question is how high supply might go. Three forces will guide its direction.

1. Owners gaining positive equity. 2.5 million homeowners regained positive equity -- meaning their home is worth more than they owe on the mortgage -- in the second quarter, according to CoreLogic. Some of these homeowners have been itching to sell for years and just now have the opportunity.

But judging how many will do so is difficult. Even homeowners who once wanted to sell and move might opt to stay put even with positive equity. It's a wild card. 

2. Homebuilders adding to supply. Homebuilders recently discovered something that's been elusive for years: the ability to raise prices. The balance they now need to strike is how much to ramp up supply versus holding back supply to maximize prices. PulteGroup (PHM -3.84%) CEO Richard Dugas said earlier this year: "In a number of communities across the country, demand has been so strong that we have taken action to slow the overall pace of sales."

But some may have a hard time ramping up supply even if they want to. As The Wall Street Journal noted last week:

Most builders responding to a recent survey released Wednesday by the National Association of Home Builders noted that lots ready for construction remain in short supply, and that scarcity is among the chief factors hindering the housing recovery.

Homebuilding CEOs have been clear in recent conference calls: There are far too few homes given demographic demand. As Lennar (LEN -2.63%) CEO Stuart Miller put it, "The bottom line is that there are too few dwellings for a growing population and for normalized household formation."

3. Pent-up household formation demand
21.6 million Americans age 18-31 live with their parents, according to Pew Research Center. That's a record, and up from 18.5 million in 2007.

There are two ways to look at this: Either it's a new normal that reduces long-term demand for housing, or it's a short-term function of the Great Recession that will return to normal once the economy picks up. I'd bet on the latter. And when jobs growth returns and household formation picks up -- it's still below its long-term trend -- demand for homes will rise as well. Like so many other statistics, the glut of young people living in their parents' basements is both depressing and a reminder of how far things have to go before we're back to normal.

From more on what to expect from the housing market in the long run, see here