I've entered Canada from the US a total of about 20 times, once for work, and all of the other times as a tourist. I've entered Canada multiple times each by bicycle, car, ferry, & plane. I've traveled to over 3 dozen countries. The ONLY country I've ever had a problem entering was Canada, and it has happened twice. The first time was fairly innocuous, I was 21 years old and had just graduated from college. I was taken to a room and an agent politely asked me reasonable questions. I wasn't searched at all.
2 years ago, however, I was interrogated for an hour by a very nasty border official while driving a rental car from northern Maine into New Brunswick. I was told to park and go inside. They asked me which states I had lived in during my life and proceeded to initiate police checks on me for each of those states. I was put in a closed, small windowless room with the agent who asked me increasingly ridiculous questions. He searched every file on my netbook (I was not allowed to watch), and looked at every photo in my camera. I hadn't gotten around to erasing the photos I had taken in Mexico the previous winter, and he was treated to looking at lots of photos of a cloud forest in the mountains of Oaxaca where a friend & I hiked for 2 days, photos of the fabulous food markets there, and photos I had just taken in Acadia Nat. Park.) At one point, he started yelling at me, demanding to know who a certain person was for whom I had created a directory on my netbook. He and another agent also did a thorough search of my empty rental car, which only contained my small carry-on suitcase.
After an hour, he marched me back into the main room, tore off a sheet of paper which he stapled to my passport and told me, "I think you're lying, but you don't have a police record and you have money, so I'm letting you in. But you can only stay until the day of your flight home (from Manchester, NH), and you have to stop at the border before you leave Canada and turn in this document. If you don't leave by that date, there will be a warrant for your arrest." I just wanted to get out of there, but before I walked back to my car I said to him, "I didn't lie to you about anything." I had no reason to lie to him about anything. Since my intention was to go to NH & VT after leaving Canada, the shortest way to get there from northern Maine was via Canada. Otherwise, I might have turned around and re-entered the US immediately.
I only stayed in Canada one night, which was 1 or 2 nights less than I had anticipated. I just wanted to get the hell out after the treatment I had received. I really mainly wanted to re-visit Quebec City, which the agent found bizarre for some reason. When I was leaving Canada, I stopped and entered the small Canadian border post (in Quebec province) to turn in the document. The 2 agents there were very nice. I told them what had transpired the previous day. One of the agents had never even seen one of those documents before. They had no explanation for why I was given the third degree.
I then drove across the border to the US side. The friendly agent asked me a couple of questions and said, "you can go". Since nobody was waiting behind me, I told him what had happened entering Canada 36 hours earlier. When I quoted the guy saying to me "I think you're lying...", the American border agent said to me, "Wow, that's different." His reaction made my day.
I told a Canadian friend of mine about this, and he was somewhat surprised because he had only heard stories from his Canadians friends who were hassled at the US border. If you search online, you will find a huge number of much worse tales by citizens of both countries being hassled while trying to enter the neighboring country.