Historically, H-1B holders have sometimes been described as indentured servants, and while the comparison is no longer as compelling, it had more validity prior to the passage of American Competitiveness in the Twenty-First Century Act of 2000.
And in the section on American Competitiveness in the Twenty-First Century Act of 2000:
Because of AC21, the H-1B employee is free to change jobs if they have an I-485 application pending for six months and an approved I-140, if the position they are moving to is substantially comparable to their current position. In some cases, if those labor certifications are withdrawn and replaced with PERM applications, processing times will improve, but the person will also lose their favorable priority date. In those cases, employers' incentive to attempt to lock in H-1B employees to a job by offering a green card is reduced, because the employer bears the high legal costs and fees associated with labor certification and I-140 processing, but the H-1B employee is still free to change jobs.