The US WHTI requires US airlines and airlines serving the US to do certain things that are independent of what is required of government employees to process someone for immigration/customs admissibility at a US or Canadian port of entry.
Airlines have to first make an effort to comply with the government; then the passengers have to comply with satisfying the airline to get checked in and transported; and (usually) after (at least some of) that mentioned previously has taken place, then the passenger has to satisfy US CBP and/or CBSA.
So three different but related things going on that have to be ordinarily cleared by different or multiple parties.