It happened at ORD to me a few weeks ago. I was coming in on a direct flight from the middle east. It was most definitely a combination of CBP and TSA personnel. I got the impression that they were looking for someone specific. Fortunately, I sat near the front of the plane because the backup built very quickly. I felt bad for anyone with a tight connection.