The framework for discretion is established directly by Congress in the Immigration and Nationality Act (INA)
Authority to Enforce: Under INA § 103 (8 U.S.C. § 1103), the Secretary of Homeland Security is given broad statutory power to administer and enforce immigration laws. This inherently includes prosecutorial discretion—the legal right for agencies like ICE to decide who to stop, whom to detain, and whether or not to initiate deportation proceedings.
Discretionary Relief: Major forms of immigration relief are written into the law as privileges, not rights. For example, INA § 245 explicitly states that an Adjustment of Status (getting a green card from within the U.S.) "may be adjusted by the Attorney General, in his discretion and under such regulations as he may prescribe."
Discretionary Relief: Major forms of immigration relief are written into the law as privileges, not rights.
Because Congress explicitly used the word discretion, getting a green card or stopping a deportation is legally considered an "act of administrative grace."