Let me give you an example. A passenger books a flight Hong Kong to Toronto via Vancouver, on Air Canada. (could be any combination of international flights but here you go)
The passenger goes through security in Hong Kong; the plane lands in Vancouver, the traveller goes through Customs and Immigration, claims their suitcase, and heads to the domestic gates. There they check their bags with Air Canada, go through security and are fully screened again and have their carryons screened.
Same deal for someone flying Vancouver - Los Angeles - New Zealand, for example, or Denver - Toronto - Halifax.
There are variables, when flying to/from/within Europe and moving between Schengen and non Schengen countries, but that may not interest everyone.