Great question — answering as the UphillTech team:
do they just ... believe it? Often they just do. But they'll assess your credibility and their operational guidelines, like they do for any other situations. For example, do the weight/volume/other characteristics of the boxes reflect what you told them about the content and your purpose of travel. Your bags are also X-rayed (or other imaging technology) by the customs. Don't they want the boxes to be there to go through them? Even if the baggage is not checked through, you must make the declaration to the border officer before taking your bags. The first border officer may refer you to secondary customs (and/or immigration) inspection. If they decide they want to do a secondary inspection,...
Full answer by xngtng: https://travel.stackexchange.com/a/203353 (CC BY-SA 4.0).
Need it done for your business? UphillTech.