The second choice, made by prosecutors for whatever reason, also has troubling aspects. It can encourage both massive disregard of the rule of law and perhaps more illegal immigration.

The two choices represent opposite sides of an issue now playing out in the presidential contest as well as in the Supreme Court. And yet they are similar. They are both exercises of discretion by law enforcement.

The right question then in this political and legal debate should be this: When does either type of law enforcement discretion go too far?

Will race be a factor in too many detentions of illegal aliens? Will a low rate of prosecution encourage lawlessness in general and also more border crossings – as well as greater hiring of such workers by employers?

Fortunately, finding a balance to this question of discretion was at the heart of Wednesday’s hearing before the Supreme Court on whether Arizona’s 2010 law on illegal immigration is constitutional. (Alabama, Georgia, Louisiana, and Utah have passed similar laws.)

A key provision in the law, SB 1070, requires Arizona police to notify federal officials if someone detained on a nonimmigration charge lacks evidence of legal residency. It is then up to the federal government to decide whether to officially charge, prosecute, and deport the person.

The Obama administration decided, it seems, to sue the state for helping it enforce federal immigration law. Its lawyer argued that a simple phone notification from a state would complicate the federal role. Resources are limited, Donald Verrilli Jr., the Justice Department’s solicitor general said, and deporting too many people might upset US relations with Mexico, the main source of illegal immigrants. The administration prefers to focus mainly on illegal aliens who have committed violent crimes, as a matter of discretion.

And the administration also worries about potential police harassment of Hispanics. “You have a population in Arizona of 2 million Latinos, of whom only 400,000 at most are there unlawfully,” Mr. Verrilli told the court, even as he claimed the case was not really about racial profiling.

But, countered Chief Justice John Roberts, “It seems to me that the federal government just doesn’t want to know who is here illegally or not,” even though it is required under law to respond to immigration inquires from state officials.

The high court will make its ruling by the end of June. Whichever way the decision goes, it could be a political bombshell during a campaign already focused in part on illegal immigration.

One focus is the proposed DREAM Act. That bill in Congress would offer a path to legal residency only for young people who have entered the US illegally with their parents – again, a partial leniency.

Both judges and lawmakers have a hard time deciding the level of discretion for dealing with the 11 million to 12 million illegal immigrants in the US. Elections, like court rulings, can bring some national consensus. So can hard facts, like a recent decline in illegals, which indicates some “self deportation.”

Giving discretion to both police and prosecutors can result in abuse, not just of immigrants, but of the law and public support for it. Yet such discretion is also sometimes an effective tool to implement immigration law, as well as deterring any type of crime.

The immigration issue exploded after the 2001 attacks by terrorists who had slipped into the US. Perhaps by the end of 2012, the nation will finally come closer to resolving the core dilemma in that debate: How much enforcement is preferred, and who can do it?