In the end, the money that towns across America gave General Motors did not matter.
When the automaker released a list of factories it was closing during bankruptcy three years ago, communities that had considered themselves G.M.'s business partners were among the targets.
For years, mayors and governors anxious about local jobs had agreed to G.M.'s demands for cash rewards, free buildings, worker training and lucrative tax breaks. As late as 2007, the company was telling local officials that these sorts of incentives would "further G.M.'s strong relationship" with them and be a "win/win situation," according to town council notes from one Michigan community.
Yet at least 50 properties on the 2009 liquidation list were in towns and states that had awarded incentives, adding up to billions in taxpayer dollars, according to data compiled by The New York Times.
Some officials, desperate to keep G.M., offered more. Ohio was proposing a $56 million deal to save its Moraine plant, and Wisconsin, fighting for its Janesville factory, offered $153 million.
But their overtures were to no avail. G.M. walked away and, thanks to a federal bailout, is once again profitable. The towns have not been so fortunate, having spent scarce funds in exchange for thousands of jobs that no longer exist.
One township, Ypsilanti, Mich., is suing over the automaker's departure. "You can't just make these promises and throw them around like they're spare change in the drawer," said Doug Winters, the township's attorney.
Yet across the country, companies have been doing just that. And the giveaways are adding up to a gigantic bill for taxpayers.
A Times investigation has examined and tallied thousands of local incentives granted nationwide and has found that states, counties and cities are giving up more than $80 billion each year to companies. The beneficiaries come from virtually every corner of the corporate world, encompassing oil and coal conglomerates, technology and entertainment companies, banks and big-box retail chains.
The cost of the awards is certainly far higher. A full accounting, The Times discovered, is not possible because the incentives are granted by thousands of government agencies and officials, and many do not know the value of all their awards. Nor do they know if the money was worth it because they rarely track how many jobs are created. Even where officials do track incentives, they acknowledge that it is impossible to know whether the jobs would have been created without the aid.
"How can you even talk about rationalizing what you're doing when you don't even know what you're doing?" said Timothy J. Bartik, a senior economist at the W.E. Upjohn Institute for Employment Research in Kalamazoo, Mich.
The Times analyzed more than 150,000 awards and created a searchable database of incentive spending. The survey was supplemented by interviews with more than 100 officials in government and business organizations as well as corporate executives and consultants.
A portrait arises of mayors and governors who are desperate to create jobs, outmatched by multinational corporations and short on tools to fact-check what companies tell them. Many of the officials said they feared that companies would move jobs overseas if they did not get subsidies in the United States.
Over the years, corporations have increasingly exploited that fear, creating a high-stakes bazaar where they pit local officials against one another to get the most lucrative packages. States compete with other states, cities compete with surrounding suburbs, and even small towns have entered the race with the goal of defeating their neighbors.
While some jobs have certainly migrated overseas, many companies receiving incentives were not considering leaving the country, according to interviews and incentive data.
Despite their scale, state and local incentives have barely been part of the national debate on the economic crisis. The budget negotiations under way in Washington have not addressed whether the incentives are worth the cost, even though 20 percent of state and local budgets come from federal spending. Lawmakers in Washington are battling over possible increases in personal taxes, while both parties have said that lower federal taxes on corporations are needed for the country to compete globally.
The Times analysis shows that Texas awards more incentives, over $19 billion a year, than any other state. Alaska, West Virginia and Nebraska give up the most per resident.
For many communities, the payouts add up to a substantial chunk of their overall spending, the analysis found. Oklahoma and West Virginia give up amounts equal to about one-third of their budgets, and Maine allocates nearly a fifth.
In a few states, the cost of incentives is not significant. But several of them have low business taxes — or none at all — which can save companies even more money than tax credits.
Far and away the most incentive money is spent on manufacturing, about $25.5 billion a year, followed by agriculture. The oil, gas and mining industries come in third, and the film business fourth. Technology is not far behind, as companies like Twitter and Facebook increasingly seek tax breaks and many localities bet on the industry's long-term viability.
Those hopes were once more focused on automakers, which for decades have pushed cities and states to set up incentive programs, blazing a trail that companies of all sorts followed. Even today, G.M. is the top beneficiary, public records indicate. It received at least $1.7 billion in local incentives in the last five years, followed closely by Ford and Chrysler.
A spokesman for General Motors said that almost every major employer applied for incentives because they help keep companies competitive and retain or create jobs.
"There are many reasons why so many Ford, Chrysler and G.M. plants closed over the last few decades," said the G.M. spokesman, James Cain. "But these factors don't mean that the companies and communities didn't benefit while the plants were open, which was often for generations."
Mr. Cain cited research showing that the company received less money per job than foreign automakers operating in the United States.
Questioned about incentives, officials at dozens of other large corporations said they owed it to shareholders to maximize profits. Many emphasized that they employ thousands of Americans who pay taxes and spend money in the local economy.