When a creator crafts intellectual property right (IPR) material, such as a new idea for a widget X, then the rights of such normally devolve onto her. This also includes matters of trade secrets. However there are a number of exceptions. One of these is if this inventive process occurs whilst in the employ of others. This is to stop a worker who having been paid, used resources and spent time denies the company the benefit of their work, A case such as the US SC's CCNV v. Reid can viewed as an aid to determine the test for if the work was made in the course of employment.
An example of such a term in a contract explicitly waiver any authorship rights would be:
"
An invention or discovery made by you will normally belong to you. However, an invention or discovery made by you will become our property if it was made:-
a. in the course of your normal duties under such circumstances that an invention might reasonably be expected to result from those duties;
b. outside the course of your normal duties, but during duties specifically assigned to you, when an invention might reasonably be expected to result from these;
"
Note that IPR are ideas from people and not the people themselves. For instance there have been attempts to prevent people from working in related other companies in the same industries, so as to clamp down on potential IPR breaches. However this has been curtailed severely - in the EU by right to work provisions and in the US by perceived restrictions on Free trade. Thus if the worker brings her own talent, then that is acceptable : not worked on code which would be considered a theft of IPR. Likewise, customer lists and contact details would be items which cannot be used by the employee in a new job.
Another check on a broad application of this would be how related the IPR is to the work. So while what an employee develops while working in a company belongs to the company, if it outside the remand of her day to day working milieu then a case could be argued it belongs to the employee. For instance the work Einstein crafted on relativity at the Berne Patent office, if he had wished to apply IPR to it, would fall certainly within this.