Contrary to much anti-refugee paranoia, it's pretty clear that the identified suspects in last week's terror attacks in Paris were European nationals. The attackers do not appear to have been Syrian refugees.

But there is a hard truth here. France and other European countries have a long and troubled history when it comes to integrating waves of immigrants from the Middle East and Africa, many of whom are Muslim. On the outskirts of Paris and other major French cities, as well as in the old steel-making region of northeastern France, there are many poor, isolated, and neglected immigrant communities like Saint-Denis, where two suspects were killed in a Wednesday raid. These communities have fostered unrest and riots for years, and helped produce the two key players in the Charlie Hebdo attack in January.

In short, they're wracked by the kind of social isolation and sclerosis that can make violent religious extremism an attractive alternative.

Economics obviously isn't the only factor in the making of a terrorist. But it's a real factor. Whether or not the welfare state provides enough for people's needs, whether there are enough jobs to give everyone a sense of meaning and belonging, and whether the overall flow of social activity represented by the market includes or excludes people — all of it can play into whether someone becomes radicalized.

In many ways, France's welfare state is exemplary. It includes "universal medical insurance, generous pensions, early retirement age, and so on," Arthur Goldhammer — a member of Harvard's Center for European Studies whose work focuses on France — told The Week. By international metrics, France's poverty rate is much lower than America's, they spend twice as much on straight cash benefits as a share of GDP (though the benefits often go to everyone up and down the income ladder), and "after-tax inequality in France is much lower than pre-tax inequality."

But France has fallen down on including everyone in the daily economic rhythms of French society. You can see this if you break down French employment by age group: For people in the prime working age bracket of 25 to 54, France has actually done a noticeably better job than America of keeping them employed over the last 15 years. Many fewer French people between age 55 and 64 have jobs, though that makes sense given the early retirement age and generous pension accounts. It's young people where the problem is.

"Youth unemployment in some of these suburbs is running well over 25 percent, sometimes as high as 30, 40 or 50 percent," Goldhammer explained. "These are rapidly growing populations, so you have a large youth contingent. And a lot of the unrest seems to be concentrated among people under 30."

Some of this is macroeconomic failure — in many ways, an even worse failure than America is guilty of. France's budget deficits have been even lower than America's for most of the last 35 years. And of course, the creation of the modern eurozone stripped France and everyone else of the ability to run their own sovereign monetary policy in conjunction with deficit spending, in the way you'd need to to juice an economy toward full employment. France's overall unemployment rate was 8 percent in 2003, and inched up over 10 percent by 2015.

But it's not just that. As Goldhammer explained it, French law divides workers into two rigidly distinct groups in the labor market: those with long-term employment contracts (called CDIs) and those with short-term employment contracts (called CDDs). People in the CDD bucket are much more likely to lose their jobs in a downturn, but they also lose out on other benefits as well. They don't get supplementary medical insurance, they can't begin accumulating money in retirement pensions, they aren't eligible for mortgages, and they can't rent certain apartments.

"It's certainly true that France has a stronger safety net than the United States," Goldhammer said. "But that safety net mostly works for people" with CDIs.

Most young people of all ethnic groups who are just starting out have to accept what is effectively second-class employment status with a CDD. "It's just harder for young people to get a foot in the door in the workplace anywhere," Goldhammer went on. France's immigrant Muslim population is unusually concentrated among this young and unemployed cohort, "so this is certainly a source of the frustration." And it was a serious problem long before the 2008 financial crisis.

Another problem: job and education discrimination, which Goldhammer described as "rampant" in France. "There have been investigations in which the same resume is sent out with a Muslim name and a French-sounding name, and the number of responses elicited by the French-sounding name is much much larger, even though the resumes are identical," he said. Government employment makes up a high percentage of all jobs in France, but here too, some agencies like the police are dealing with racial and ethnic discrimination in their institutional culture. (France used to have neighborhood policing programs, which actually paired cops with social workers and assigned them to specific housing projects, so they could get to know the individuals in the community. But since 2008, they've been drastically cut back.)

As for education, France runs all funding through the national government, which ought to produce an equitable distribution of education resources. In practice, many schools in the poorer immigrant suburbs are in similar shape to the largely minority schools in impoverished urban communities in the United States. "There's much less spending on suburban schools, the quality of teaching there is often not so good, and the physical state of school buildings in the suburbs is frequently dilapidated," Goldhammer continued, though he pointed out that in recent years France has begun taking steps to redress the inequity.

A final issue is residential segregation: Patterns of construction have left many of the poor immigrant suburbs located on city outskirts, far from the centers of socioeconomic life where jobs are plentiful — which is particularly the case around Paris. "So if you live there, in order to get to jobs, you have to spend a substantial portion of your income on public transportation," Goldhammer said. "And there are some subsidies to aid with that transportation. But it's not enough, it's difficult, and it's time consuming to take these long train rides."

France's tax burden is relatively flat, so it could cut taxes for the poor but maintain spending, thus boosting its deficit and driving more aggregate demand. But the monetary cooperation it would need form the eurozone to do that is unlikely. Goldhammer suggested revamping the schools and the old neighborhood policing programs, and Paris is mulling a big urban planning push to integrate the suburbs more fully into the city's life. But of course, the climate of budget austerity hampers those goals.

There are no easy answers. And meanwhile, many of France's immigrant and Muslim residents remain caught in the same trap: not impoverished, exactly, but certainly not doing well; isolated and alienated, far from the ebb and flow of economic life in the country that is ostensibly their home.