They wouldn't try to search you unless there was some suspicion of wrongdoing. These aren't random searches like at a border crossing, this is a case of someone in the store saw something that led them to believe the person in question may have shoplifted.
Uh no, I'm sorry but that''s just not correct. There may be differences between where you and I live, but here and many other places in the US they try this BS tactic of stopping you to check your receipt and any/all bags you have (shopping or otherwise) to make sure the items add up one to one. They don't have any reason to believe you stole anything, they don't think you stole anything, but they want to check you to make sure and put on a show to try to intimidate the casual thieves. They got the idea from Costco and other membership stores where you agree to the examination as a condition of shopping there (part of the membership contract you sign); The difference is that Best Buy, Target, Walmart, and the other non-membership stores that try to pull that stuff didn't make the consumer sign anything or put any other conditions on shopping at their location. The best they can do ask you to leave but once you pay for your merchandise it is yours and they have NO right to make you consent to a search.