Contrary to the myth advanced by opponents of reform that illegal immigrants don’t contribute their fair share in taxes, and drain government benefits, the reality is that undocumented workers are helping to keep the social security trust fund in the black. They do this because they are paying into the system typically with false social security numbers, which means they will never collect benefits. Their money, often collected for many years, helps keep the system afloat and benefits flowing to aging baby boomers.

President Obama’s executive order opens the door to legalizing some five million immigrants, allowing them to apply for work permits and acquire a legitimate social security number. That means the social security administration will “lose some revenue that was found money from people who pay in and will never collect,” says Norm Ornstein, a resident scholar at the conservative American Enterprise Institute.

This is not an insignificant amount of money. When payroll contributions cannot be credited to a verifiable number, they go into what’s called the “Earnings Suspense File.” A study that was done last year by the Center for American Progress (CAP), a liberal think tank, found that this file is estimated to have accumulated one trillion dollars worth of tax contributions.

Not all of that “unmatched money” is from illegal workers, says Marshall Fitz with CAP, but he felt comfortable saying, “A significant portion of that suspense file has been funded through undocumented workers who currently will never see those benefits.”

Here’s how the math works. Five percent of the U.S. work force is undocumented, which is some 8.1 million people. Thirty-eight percent of the 8.1 million pay social security taxes, which comes to roughly $12 billion a year, according to CAP estimates. That’s a pretty nice cushion for a graying America.

Stephen Goss, chief actuary for the Social Security Administration, told the Daily Beast, “Even as it stands under current policy, unauthorized immigrants contribute positively to the financing of social security not only in terms of their own contributions, but in the succeeding generations when they have children on our soil that are citizens from day one.”

Obama’s executive order would allow newly legalized workers to eventually collect benefits when they reach retirement age. But that’s a long way off for many of them, and any potential loss would be more than offset by the millions of young workers who will be brought into the system to pay taxes for three or four decades before they can collect benefits.

“The biggest problem we have with social security is there are fewer Americans to pay into the system to support people who are currently retired or about to retire,” says Ornstein, “so the more people working and paying into the system is better for everybody.”

Henry Aaron, an expert on social security at the Brookings Institution, says that looking ahead 75 years into the future, the legalization of some five million immigrants by executive order would be “like a boost in population—and a higher population is typically good for the (social security) trust fund. It’s equal to an increase in net migration, and when people enter the system, and that group is young and working, that’s positive.”

This is because immigrants are the lifeblood of the U.S. economy. The non-partisan Congressional Budget Office said the bipartisan Senate bill passed last year with 68 votes would cut the deficit by $820 billion over 20 years.

“Opponents of doing anything but deport or self-deport say these are people who are relying on government benefits, taking jobs from hardworking Americans,” says Ornstein. Immigrants without legal documentation are forced to work “off the books,” or “under the table. This is an arrangement that suits more employers than probably would care to admit it, because they avoid paying their fair share of taxes on those workers.

Obama’s executive order would move these workers from what Brookings scholar William Galston calls the gray economy into the sunlight economy. And if you’re bringing people into the official system who were not there previously, and they are in their 20’s and 30’s, and they’ll be paying taxes for 30 and 40 years, “common sense says that’s a good thing,” he says.

Common sense is too often in short supply in the emotional debate over immigration reform and Obama’s executive action. But as America faces two great demographic shifts taking place simultaneously—the graying of America and the browning of America—the economic benefits of legalizing millions of people are clear for those directly affected and for the country as a whole.

What is less clear is how workplaces accustomed to exploiting workers will adjust to newly empowered immigrants less afraid to stand up and be counted and claim what they’re entitled to.