It's possible something else caused the CBSA agent to search her belongings. At customs, they sometimes ask where you are coming from and purpose of trip. Depending on answers, demeanour or even items declared on the declaration card, the agent could flag you for a search. Also, travelling from countries with known for drugs or terrorism can be a red flag, particularly if you are not from that country. The agent in that case would be interested in why you travelled there. They also know that detaining/holding someone for long hours (6 hours in this case) is likely to break you down (classic interrogation technique), and can explain why after 6 hours the OP felt exhausted and decided to tell them whatever they wanted to hear. Watch the "Border Security" show, it gives some insight into how CBSA operates.