The apartment and for-sale housing markets usually compete with each other. Historically, the math has been simple and brutal: If the percentage of people who own homes goes up, then the percentage of people who rent goes down. Good news for housing sales often means bad news for the apartment sector, if the number of households that need homes stays stable.

But what’s happening today is different, according to the economists at the National Association of Realtors (NAR). “Rental demand and housing sales are rising at the same time,” says NAR spokesperson Walter Maloney.

What’s behind the seeming contradiction? The number of households is growing again after years of lagging behind the growth in the population. For years, graduates have been moving back home or sharing dwellings with roommates. Now, more people are striking out on their own. And this formation of new households is creating strong demand for both rental and for-sale housing.

The housing inventory has also lagged behind the growth in the population for years, so that both rental and for-sale housing are in short supply. A sharp increase in home construction would create more supply, but could also create jobs, new household formation and more demand for housing, according to NAR.

Lots of demand

The for-sale housing market is recovering faster than seemed possible just last year. Many economists expected for-sale home prices to drop in 2012, such as the analysts at Freddie Mac. Instead prices rose more than 7 percent, according to indexes kept by both Case Shiller and the Federal Housing Administration. The number of sales is also rising quickly, despite the small number of homes on the market.

Low home prices and interest rates have also turned the cost of owning a home into a good deal compared to the rising cost of renting an apartment. NAR’s Housing Affordability Index hit an all time high in 2012, meaning that homes were more affordable on average than at any other time since NAR started keeping records in 1970.

New households helped fueled demand for housing. “Household formation has now returned to normal,” says Maloney. NAR predicts household formation is returning to its old relationship to population growth this year. “We are adding 3 million people a year,” says Maloney. “We need 1.5 million housing starts a year.”

Little supply

However, the actual number of housing starts is far less than that. Developers started 780,000 housing units in 2012. Economists including NAR expect 1.1 million in 2013.

Of course, homebuilders could always create more homes. Building hundreds of thousands of new homes would create millions of new jobs. Some of those new jobs would allow newly-hired workers to move out of their parents’ basements and form new households, racheting up the demand of housing even higher.

At the current level of supply, renters who try to buy a for-sale home often have a difficult time finding a home to buy, according a tall stack of local press reports from housing markets across the country.

Even though the real estate recovery is just beginning to spread to for-sale housing, the number of homes available for sale is the lowest it’s been since 1999, the last year of the Internet boom. The inventory of homes available for sale was just 1.74 million in January, enough to last 4.2 months at the current rate of sales, according to NAR.

Also, for years we have also heard about the coming flood of homes—now totaling about 3.4 million—that are still in foreclosure or seriously late in their payments. But banks are can’t overwhelm the housing markets by trying to sell these homes all at once, even if they wanted to. Many are tied up in the foreclosure process. “We continue to have a significant number of properties in our REO inventory that we are unable to list because they are occupied or in states with a redemption period,” according to a statement by Freddie Mac.