As regards airlines, I do know they feed the passenger data to the security people somehow, in bulk, well in advance, so when the plane lands the Plod can be there waiting. There is some kind of datalink.
It's know as API -
Advanced Passenger Information. Some states require it, notably Spain and the US, and some don't. Generally the required information is collected when you check in, either online or at the airport.