As you may have seen, immigration law is very complex. Each case is different. If someone is a legal resident, that person will be facing deportation or detention if he or she did something to put that status in jeopardy. So it depends on the particular situation of the resident and how immigration officials found out about it.
If there is a specific case you are thinking of, I suggest that person speak with an immigration attorney.