I have worked (as a courier, as well as on the docks) for FedEx ground for over 5 years during my life.
When you sign up for a shipping account, you authorize FedEx to open your shipment. Some of this, IIRC, is to cover for cases of package damage and the need for FedEx to repackage your goods. I've seen cases of their shipping centers opening a dropped off package because they had reason to suspect the shipper was sending alcohol, which in most cases requires a special permit and is governed by some strict regulation.
In general, to cover themselves, they reserve the right to open and inspect any package. I'm fairly certain that so does UPS. I'm not sure about the Post Office.