Police officers can't stop anybody and say "Are you here legally?" and question them about their immigration status. Under this law the police officer must have reasonable suspicion to believe the person's here illegally. And this will almost always only occur after the person has been lawfully stopped for some other offense, maybe it could be a traffic offense.
So a police officer pulls over somebody who maybe rolls through a stop sign, walks up and says "License and registration."
The individual says "Well, I don't have a driver's license on me."
The officer says "Well, why not?"
Driver says: "It's suspended."
"Well what's your name and date of birth?"
Gives it. The officer goes to his radio. Checks the records because you can cross check licensing information. Discovers there is no such issued license. Goes back to the driver.
"Hey, there's no license issued in your name. What do you mean suspended?"
"Oh, ahh, well, uhh I don't have an Arizona license. It's a Mexican license, I came from there."
"Oh. When did you come? How'd you get here legally? Where'd you go to get the form? Did they give you paperwork? Do you have documents? Oh. you have a green card. What color is that card? Green? Well, you know green cards aren't green."
That's how you build up reasonable suspicion. Police officers, when there are independent observable facts that just create suspicion, all that allows us is a brief questioning about immigration status.
During the questioning, the police officer is going to look for lies, conflicting answers or he may look for evasive answers. And as the person gives those and as he observes other things, each response is another grain of sand. And it goes on a scale.
And the stop occurred because there was reasonable suspicion.