Depending on the location a licensed guard can detain any individual for reasons such as:
1. "ascertain his or her identity and the circumstances of the person’s activity."
2. "probable cause to believe that a person has committed or is committing a crime..."
This is all dependent on whether the site under protection is considered a "critical infrastructure facility." Simply put, it's places like power plants, refineries, water treatment centers, secured areas that are vital to the society and economy at large.
Learn more about this statue here