Often, the key to keeping trade secrets is simply to restrict the number of people who have access to them in the first place. Some companies are famous for keeping their recipes and formulas confined to one or two individuals. This way, even if an employee wanted to leak the secrets, they'd have no way to do so. It does not take nearly as much loyalty to avoid an issue.
However, this is not always possible if you have to work with outside vendors. They may help at any stage in the process: Providing materials, assembling products, handling sales and distribution, hiring new workers, mixing chemicals, etc. It depends on the specific job being done, the needs of the company and how much of the critical work the company is capable of handling on its own.
If you do have to work with vendors, you may worry about a leak. They may not have the same loyalty you find with your own staff.
One way to keep the final product a secret is to use multiple vendors. Say your product has three main parts. If they all come from the same vendors, it's not hard for them to understand the assembly process. If you pick three different vendors and you never disclose what each part will do or how it relates to the others, they can't reverse-engineer it nearly as easily.
Sometimes caution is not enough, though, and that's when you need to look into all of your legal options. For instance, your contract with the vendor needs to have a strict confidentiality provision, and you need to know what steps you can take if they ever violate it.