Apple has pledged $2.5 billion to help address California's affordable-housing crisis, the company announced on Monday. In recent years, the San Francisco Bay Area has become the most expensive housing market in America. Los Angeles also suffers from housing costs far above the national average.

Apple's $2.5 billion package includes several different initiatives. Apple will offer a $1 billion line of credit to organizations building housing for low-income people.

Another $1 billion will be used to help first-time homebuyers—especially "essential service personnel, school employees, and veterans." In communities like Cupertino, where Apple is based, cops and schoolteachers often struggle to afford housing near their jobs.

Apple says it will also donate land worth $300 million in San Jose for a project to build thousands of new affordable housing units. Another $150 million will go to support various affordable housing projects in Silicon Valley, while a final $50 million is earmarked for a nonprofit that focuses on homelessness in Silicon Valley.

Apple's commitment follows on the heels of similar announcements by other technology giants:

In January, Microsoft said it would provide $500 million in grants and loans to promote affordable housing in the Seattle area and aid the homeless.

In June, Google announced a $1 billion initiative, including $750 million worth of Google-owned land, to support the development of at least 20,000 new housing units "at all income levels" in the San Francisco Bay Area.

In October, Facebook unveiled its own initiative to offer $1 billion in grants and loans to support the construction of 20,000 housing units in the region.

Apple's initiative is larger than the other programs and appears to be more focused on low-income housing.

Corporate initiatives alone can’t fix California’s housing problem

These efforts to promote affordable housing are laudable, but corporate initiatives alone are unlikely to solve California's housing crisis. The Golden State's fundamental housing problem is that state and local laws simply don't allow developers to build enough housing to accommodate rising demand.

In the 20th century, cities could accommodate growing demand for housing by pushing suburbs outwards. But in major metropolitan areas like San Francisco and Los Angeles, that process has largely run its course. Most of the land within a reasonable driving distance of job centers has been developed. Which means that the only way to accommodate further growth is by increasing density: replacing single-family homes with duplexes, townhouses, and apartment buildings.

The problem is that the law doesn't allow this in most areas. A Los Angeles Times analysis found that 62% of land in Los Angeles is zoned for single-family homes only. In San Francisco, 75% of the land is zoned not to allow anything denser than a duplex. Laws in suburban Silicon Valley are even stricter.

At the same time, the technology boom has put more and more money in the hands of residents associated with the technology sector. So more and more dollars are chasing housing, while the supply of housing has barely increased from year to year.

The Apple, Google, and Facebook initiatives aim to address this by either subsidizing the development of specific housing projects or by helping lower-income homeowners afford the inflated cost of housing. These are worthwhile initiatives, but there's only so much they can accomplish while the overall supply of housing is so strictly limited.

If Apple provides some low-income families with financial assistance to buy homes, that helps those homeowners. But there's a risk that this simply means that other families with similar incomes—but without help from Apple—get priced out of the market.

Legislation to liberalize housing regulations got tabled

Ultimately, the only way to make housing affordable is to build a lot more of it. And that won't happen without changes to the law.

This year, state Sen. Scott Wiener, a Democrat who represents part of San Francisco, sought passage of legislation to overhaul the state's zoning rules. His bill would loosen housing regulations near bus stops, subway stations, and areas with a lot of jobs, allowing for the construction of more apartment buildings nearby. A boom in high-density apartment construction could alleviate the state's severe housing shortage and slow the seemingly inexorable rise in housing costs.

But the bill has attracted strong criticism—both from tenants' rights groups worried that it would accelerate the process of gentrification and from neighborhood activists who simply don't want apartment buildings built near their single-family homes. Opponents managed to get the bill shelved in May. It is due to come up for reconsideration next year.