The government struggles with a lot — but one thing it excels at is writing checks.

There’s a reason Social Security is one of the U.S. government’s most popular programs: Fraud is minimal. There’s very little hassle with government bureaucrats, and since the program took effect, the elderly poverty rate has fallen from almost 80 percent to 10.9 percent. Check-writing is simple to administer and efficient at meeting its goals: If you give someone money, they will definitely have money.

Unfortunately, as I noted in a previous column, checks are of limited avail against hard problems. Three studies showed that even substantial transfers did little to help low-income people. Understandably, some readers found this disappointing and infuriating. “What’s your solution, then?” they demanded.

One answer is that there might not be a solution to every problem. For example, the staggering increase in single parenthood is clearly bad for parents and kids, but it’s hard to imagine how the government could significantly boost marriage rates.

That said, there’s more we could do to help lift people out of poverty. The problem is those things will be more challenging — and possibly, even less politically popular — than the checks. Because what we really need are healthier, more economically integrated neighborhoods where kids are connected to opportunity, not by the government, but by the people around them.

This insight comes from Harvard University economist Raj Chetty, who leads a team of researchers using tax data and census records to study how incomes change over time and between generations. They found that neighborhoods matter intensely. A seminal paper published in 2014 showed that a child born in poverty in San Jose was almost three times more likely to reach the top of the income distribution than a similarly poor child growing up in Charlotte.

This isn’t just because nicer neighborhoods have nicer amenities. Areas that promote mobility have less racial and economic segregation, more community involvement and more two-parent families. And the benefit of a preponderance of two-parent families doesn’t just accrue to children of married parents; even the children of single parents do better if they’re living among two-parent families.

Chetty and his team’s most recent paper looked at how racial gaps in economic mobility have changed over time throughout the country. The good news is that when you compare children born in 1978 to those born in 1992, you see shrinking gaps between the likelihood that a Black child will exit poverty and the likelihood that a White child will. The bad news is that there is a growing class gap among White children; those born at the bottom in 1992 had lower incomes than their 1978 counterparts, while incomes at the top rose.

Communities where employment was rising had better outcomes than others. Mobility was also correlated with marriage and mortality rates.

It’s great news that racial gaps are closing, and we have some idea about what’s causing the remaining gaps. But “boost employment” is a much harder task than “give people money” (government-sponsored job training programs, the obvious solution, have a dubious record).

I asked Chetty if this isn’t sort of a counsel of despair: We know what conditions help, but, alas, don’t know how to create those conditions. Chetty gently suggested I was being too pessimistic. We might not be able to create a thriving community by government fiat, but we can help people move to communities that provide better opportunities for children — not just by covering some of the rent, but by providing housing navigators who can help people find the right place and get the paperwork done. We can design schools, community programs and zoning policies that reduce, rather than exacerbate, economic and racial segregation (or, the libertarian columnist adds, we could give people vouchers to send their kids to better schools).

The challenge is this will require the government to be very good at its job. We frequently focus on programs and rules, but bureaucratic capacity and political leadership can make the difference between a successful intervention and one more government program that doesn’t work. That political leadership will also have to overcome objections from comfortably middle-class families. Many people who rue segregation and poverty in the abstract, and are happy to write checks, will balk at personally contributing to the work by living in economically mixed neighborhoods and sending their children to schools where the focus is on integrating the bottom rather than catering to the top.

And this might be the biggest problem with the checks: They allow us to feel we’ve done our duty without actually doing what it takes to solve the problem. If we’re serious about tackling intergenerational poverty, we need to be willing to contribute not just our funds, but ourselves.