Originally Posted by
beachmouse
Note that this is not US border control per se. It's because an airline can face large fines if one of their international passengers is denied entry upon arrival to the destination country. So the airlines tend to be rather to very careful about making sure all passenger paperwork is properly in order before people board an international flight.
But it is also essentially border control because the airline supplies a manifest which CBP uses to record exits from the country, and by checking passports they're also checking that the manifest is correct.