If a person is taking a day trip to the US and gets infected that day, a test taken that same day after they are infected will not come back positive as there is not enough viral load yet - the person is still in the incubation period. It takes a number of days to have enough viral load to get a positive test result. Here in Ottawa, for example, public health officials don't recommend getting tested after a known exposure until 5-7 days after because if one tests "too early" the test is highly likely to come back negative even if one is actually infected. According to the Government of Canada: "The incubation period ranges from 1 to 14 days. The median is 5 to 6 days between exposure and symptom onset. Most people (97.5%) develop symptoms within 11.5 days of exposure."
If flying to the US, one is required to have a negative test done before travel to enter the US. They do not require a test for land border entry. So some travelers would have the pre-test because they needed it for entry to the US.
For others, the logistics of testing in the US for a land crossing daytrip of a few hours also don't make sense. For example: pre-covid my typical day trip to the US lasted 1-2 hours, sometimes less, of time stateside. The nearest US location I can get a rapid covid test acceptable for Canadian entry is about a 30 minute drive from where I normally go, so that is an extra hour in the US. That test location is a Walgreens and it can take upto 24 hours to get results. So that could be an additional DAY I would have to stay in the US just for the purposes of a test. That would incur meals, possibly an overnight hotel stay, plus finding a low risk way to pass the time. Bottom line: a lot more time in the US and more contact with more people. Just because of the test and its logistics. Versus being able to use a Canadian pre-travel test, where once in the US I have contact with a small number of people (as few as two plus border guards) and can limit my time stateside to under an hour. Which makes more sense and is safer ?
You are right that there then would be no way of knowing if they did manage to pick up something in the small window they were outside the country. It would be a matter of monitor yourself for symptoms and if you get any go get tested.
SW