A trillion-dollar, pork-filled farm bill stuffed with corporate welfare passed the House last week and cleared the Senate on Tuesday -- thanks in part to a little-noticed maneuver by the bipartisan leadership in both chambers.

Liberals, conservatives, libertarians and conservationists all opposed the farm bill on many policy grounds:

The bill perpetuates the federal sugar program. Arguably Washington's least defensible corporate welfare boondoggle, the sugar program keeps out foreign sugar, hiking prices for consumers, killing jobs for candy makers and enriching a few politically connected sugar producers.

The farm bill replaces a flawed program of direct payments to farmers with a potentially more wasteful program of subsidized crop insurance, which takes money from taxpayers and gives it to banks and farming businesses.

Lawmakers also stripped out of the final farm bill a provision that would have required congressmen to disclose the farm subsidies they receive from taxpayers.

Liberals, meanwhile, hated the bill's cuts to food stamps.

The list of problems goes on, explaining opposition from the Environmental Working Group, the National Taxpayers Union, Heritage Action and experts from the liberal Center for American Progress.

The bill had its supporters, of course: the agribusiness lobby, the farm-finance lobby, the White House and the Congressional leadership of both parties. This union of K Street and party leaders hasn’t been sufficient in recent years to overcome conservative and liberal intransigence on a handful of issues. How did the establishment win this time?

The key may have been a little-known law called “Payment in Lieu of Taxes.”

The federal government owns about 30 percent of all U.S. territory, including a majority of land in Nevada, Utah, Oregon, Idaho and Alaska. States and counties don’t collect property taxes from this land, and so the federal government offsets some of this loss with federal funds known as “Payments in Lieu of Taxes,” or PILT. (Some states and municipalities accept payments in lieu of taxes on property owned by colleges and universities, museums, hospitals and the like.)

Renewing PILT funding is normally automatic: Even fiscal conservatives don’t object to federal spending if it’s the federal government compensating local government for the impact of Washington’s massive footprint.

Last year, the Interior, Environment, and Related Agencies Appropriations bill reauthorized PILT funding. That Interior bill was folded into the omnibus spending bill that came to the House and Senate floor in January. Members learned shortly before the bill came up for a vote that PILT was stripped out.

Western Republicans objected to the move. Conservative Idaho Rep. Raul Labrador, in explaining his vote against the omnibus bill, cited the removal of PILT funding. Labrador, according to a spokesman, “was disappointed PILT was not included in the omnibus.”

Instead, PILT funding was stuck in the farm bill. This helped swing Labrador from a "no" vote on the farm bill last year to a "yes" vote this year. PILT money “was one of the reasons he decided to vote for the farm bill,” Labrador’s spokesman told me.

Other Republicans, including Rep. Mark Meadows (whose North Carolina district consists mostly of national forests, a Cherokee reservation, and the Great Smoky Mountain National Park) supported the farm bill because it had PILT funding in it.

Why move the PILT money from the omnibus spending bill to the farm bill? Leadership in both parties offer their own explanations, but rank-and-file members in both parties have the same explanation: Party leaders in January knew they had enough votes without PILT to pass the omnibus, and they knew they would need to win some Western conservative votes for the farm bill. So the PILT funding was pulled from the omnibus and moved to the farm bill.

The switch “was designed to make it a tougher votes for House Republicans” to oppose the porked-up farm bill, Labrador’s spokesman told me.

A Democratic congressman I spoke with confirmed that winning over conservative votes was the reason for moving the PILT funding. “It was a smart move,” the congressman told me. And Democrats are right to applaud it: “All it did was improve the leverage of Senate Democrats,” one Republican aide told me.

With conservative House members forced by the PILT funding to vote for any bill that came out of the House-Senate conference, Senate Democrats were in a stronger position to propose more subsidies and more spending.

The Ag lobby got what they wanted. The GOP leadership passed its bill. Democrats got their trillion-dollar price tag.

Congress may not be getting any better at making good policy, but the parties' leaders are learning again how to get things done — for better or worse.

Timothy P. Carney, The Washington Examiner's senior political columnist, can be contacted at tcarney@washingtonexaminer.com. His column appears Sunday and Wednesday on washingtonexaminer.com.