I was surprised to see US border control at Toronto Pearson but I suppose it makes sense to screen passengers on this side given the proximity of Toronto to a US workforce, and it would alleviate US airports to receive Canadian traffic as a pseudo-domestic arrival (I assume this is what happened when I flew YYZ->DFW)
> Today, CBP has more than 600 officers and agriculture specialists stationed at 15 Preclearance locations in 6 countries: Dublin and Shannon in Ireland; Aruba; Bermuda; Abu Dhabi in the United Arab Emirates; Nassau in the Bahamas; and Calgary, Toronto, Edmonton, Halifax, Montreal, Ottawa, Vancouver, Victoria, and Winnipeg in Canada.
the other reason is that if canadian traffic can come into the US as domestic pre-cleared, then travelers are free to transfer within the US much more easily. this makes things much easier for places that do not have direct connections to Canadian airports.
(in the US, even if transiting to another country you are required to clear US customs.)