THE legal controversy surrounding the Obama administration’s immigration enforcement policies will soon come to a head when the Supreme Court justices hear the case United States v. Texas on Monday. Texas claims that the president’s executive decisions lack legal sanction by Congress and have injured the state.

But whether or not you like President Obama’s actions, he has operated under longstanding provisions of law that give the executive branch discretion in enforcement. This presidential prerogative has been recognized explicitly by the Supreme Court. Moreover, the nature of immigration enforcement and the resources (or lack thereof) appropriated by Congress necessitate exactly the type of choices that the president has made.

Congress has repeatedly granted the executive branch broad power in enforcing immigration laws. The 2002 law creating the Department of Homeland Security explicitly said the executive should set “national immigration enforcement policies and priorities.” The Supreme Court has recognized the leeway Congress gives the executive branch in deportations. In a 2012 majority opinion written by Justice Anthony M. Kennedy and joined by Chief Justice John G. Roberts Jr., the court noted that “a principal feature of the removal system is the broad discretion exercised by immigration officials,” including the decision “whether it makes sense to pursue removal at all.”

Setting enforcement priorities is vital to the effectiveness of our immigration laws. Congress can’t anticipate every situation. This is why the Supreme Court recognized in 1950 that immigration law is an area where “flexibility and the adaptation of the congressional policy to infinitely variable conditions constitute the essence of the program.”