At some airports (such as Frankfurt airport's non-schengen zone), the border police/immigration sometimes start checking passport/visa and asking questions at arrival gate, and afterwards passengers have to go through the actual passport control anyway. This also happens occasionally at airports in Canada (and rarely in US - mostly just flights from sensitive countries) when officers started to question foreigners as they get off the plane and then of course there is the real border control aftwerwards. What is the point of this, really? To identify suspcious illegal migrants a bit early, before they go through the actual border control in just a few minutes?
In Frankfurt, there will be some passengers who are not expected to reach passport control at all because, having arrived from a non-Schengen airport, they are on their way to another non-Schengen airport. Some of these passengers are required to have an airport transit visa. The officers may be verifying these visas as a form of audit to confirm that the airline has processed and reported these passengers correctly.
Other reasons for such checks could include suspicions about specific individuals on the flight (whether they are wanted for a crime or merely suspected of an immigration violation), or concerns that some might do something undesirable between arrival and passport control (or, if applicable, between arrival and international departure without needing to go through passport control). For example, there could be some passport-swapping scheme.
Of course, the scrutiny may also have nothing to do with immigration matters but could be looking for smugglers (before they have time to pass their goods on to someone else or hide them somewhere in the airport) by checking for people who become nervous under questioning.
A guess: sometimes travelers will destroy their own travel documents before reaching passport control, for a variety of reasons that the destination government doesn't approve of. Doing a check before the traveler has access to a toilet, garbage can, etc, makes this more difficult.
In some airports, travellers in transit with certain citizenships are handled differently: they will be escorted to a secure area, where they will be held until their connecting flight departs (to which they will be escorted as well).
There is a strong link between citizenships which are required to have an airside transit visa and such procedures.
The actual reason for this (both ATV and the escorting) is unclear, but is usually related to people pretending to connect but actually attempting to enter the country at the connection airport.
It may be:
- because there have been known security holes allowing people to bypass the normal border checks somewhere (possibly once they are in the waiting area for their connecting flight —- lots of shops, restaurants and services, so opportunities for well organised networks to get someone out)
- Because once they are in the airport they will go to passport control and try to claim asylum. Not sure whether that can actually work nor how escorting them will avoid the issue, but I’ve seen that mentioned
For this case, in my experience the checks are cursory for people with a “good” passport: just vaguely wave your passport and you’ll be let through.
Another case is when temporary internal Schengen checks are reintroduced and for operational reasons they can’t route you through normal passport control (though this does not quite match the case in the question). In that case I’ve seen officers with special mobile passport check terminals at the gate, checking everybody like they would at a normal passport control booth.