At the time of check-in one of the Agent's primary duties is to check for valid documents. This includes tickets, passports, visas, letters of consent etc. (depending on the type of visit, the arrival and destination of the trip).
In countries like the United States and United Kingdom, which has special requirements, passengers have to provide information like their name, address and contact details of places in which they live, from which they are taking the flight and in which they intend to stay once in the United States and United Kingdom respectively. This information, known as Advance Passenger Information, is now usually collected online with or after the flight booking.