score:6
It depends on your departure country and airport, your port of entry in Canada as well the airlines operating the two flights.
The base rules are that you have to pick up your baggage and exit customs at your first port of entry and that you have to pass through security again.
Even if an exemption may be available, for operational and other reasons (e.g. arrangement of terminals), the crew, airport staffs or government officials may give you specific directions while arriving.
Both arrangements described below are not mandatory and depend on the participation of the specific airport and carrier.
And for summer 2022 at least, everything you read below (or anywhere) may or may not apply as everything is a mess at every (Canadian) airport for any airlines no matter where you are going to or arriving from.
One Stop Security (OSS) is the arrangement where Canada recognizes adequecy of the security screening of another country and may exempt transit passengers from additional screening if the infrastructure allows.
Currently, OSS is possible (but not mandatory and not always available) for European (EU/EEA/Switzerland), Australian and U.S. arrivals. All departure points on the ticket may matter. Airports may have restrictions that apply to passengers who departed from an airport outside OSS countries recognized by Canada (e.g. Japan-EU-Canada).
The International to Domestic Connections Process (ITD Process) is the arrangement between CBSA and airport operators that may allow airlines to directly transport arriving baggage to the final destination.
CBSA reserves the power to recall/inspect an arriving luggage at any point in the process.
The availability depends on the departure point, the airport and the airlines.
Some Canadian airlines and international airports have connection tools available that may inform you regarding the possibilities to benefit from these facilities.
For example, Air Canada's page on international-to-domestic connections at Toronto Pearson (YYZ) lists the availability of checked-through baggage. At Vancouver (YVR), all Air Canada international arrivals may benefit from ITD baggage transport.
Forums like Flyertalk may also be helpful.