One can get arrested by the police following an infraction and perhaps get away with Immigration getting involved. However, some criminal arrests will be followed by a detainer placed by Immigration and Customs Enforcement (ICE) because of the nature of the underlying offense.
Alternatively, one can also get detained by ICE after having been convicted of a criminal offense (even years later) or upon discovery of the person’s unlawful presence or commission of a removable act (such as marriage fraud, misrepresentation…). Detention can also occur with Customs and Border Protection (CBP) upon entry into the U.S. or after a deferred inspection.
Those agencies may decide in their discretion that the detention of the foreign national does not serve the government or the foreign national’s family and place this person under supervised release or release the foreign national on his own recognizance.
Alternatively, once a detainer is placed on the foreign national, it is possible to have an immigration attorney involved to attempt to lift the hold. However, and in many occasions, ICE will transfer the foreign national to a detention facility, if removable, and wait for a hearing before an Immigration Judge. If eligible, the foreign national may benefit from a bond hearing and obtain a release from detention pending the removal proceedings. There are cases where mandatory detention applies (such as with most criminal convictions) and the foreign national is not eligible for bond, such that he or she will be detained throughout the pendency of the removal proceedings, until a final decision is made on the relief sought (if any).