Typically, employee-inventors who invent something in the course of their employment are bound by employment agreements that automatically assign all rights in the invention to the employer. While smart research and development companies give their employee-inventors bonuses for valuable inventions, this is a matter of contract rather than law.
Even without a written employment agreement, an employer may own rights to an employee-created invention under the "employed-to-invent" doctrine. If an inventor is employed -- even without a written employment agreement -- to accomplish a defined task, or is hired or directed to create an invention, the employer will own all rights to the subsequent invention. Most companies prefer to use a written employment agreement because it is more reliable and easier to enforce than an implied agreement.
Both written employment agreements and the "employed-to-invent" rule allow the employer to become the owner of all patent rights. An employer may also aquire a "shop right," rather than ownership of patent rights.
Under a shop right, the employee-inventor retains ownership of the patent, but the employer has a right to use the invention without paying the employee-inventor. A shop right can occur only if the employee-inventor uses the employer's resources (materials, supplies, time) to create an invention. Other circumstances may be relevant, but use of employer resources is the most important criterion.
For example, Robert is a machinist in a machine shop and, using his employer's resources, invents a new process for handling a particular type of metal. If Robert hasn't signed an employment agreement giving his employer all rights to the invention and if Robert was not employed to invent, Robert can patent and exploit the invention for himself. His employer, however, would retain the right to use the new process without having to pay Robert.