Simple, fool!
If they were LEGAL residents, THEY WOULD NOT BE ALLOWED TO BE DETAINED, just as YOU cannot be detained unless you've done something illegal! That's because you and I enjoy a CONSTITUTIONALLY LEGAL STATUS THAT THEY DO NOT HAVE, unless and until they go through the courts and get approved as a refugee or are granted asylum by that court!