With its $500 million pledge to address affordable housing in the Seattle area, Microsoft isn’t primarily cutting checks to local charities. Private companies have done that before. Nor is it proposing to create housing for its own employees, as corporations have done in the past, too.

Rather, Microsoft is trying to help fix a market failure — a job government typically does.

“It really represents something almost unprecedented,” said Matthew Gordon Lasner, an associate professor of urban studies and planning at Hunter College. “What we’re seeing Microsoft do is in effect privately assume the role that historically the federal government and the states have played.”

Microsoft’s announcement is welcome news in the Seattle region, where housing costs have risen faster lately than in any other part of the country. But the fact that a tech company has to step in to help ensure the development of affordable housing points to a long-building reality nationwide: The federal government has largely retreated from this role.

The government spent about three times as much on housing programs in the 1970s as it does today, according to the National Low Income Housing Coalition. In the years since, the government has gotten out of the business of building public housing. And capital funds to repair the remaining public housing stock have been cut in half over the last 15 years.