It's relatively straightforward to transfer a H1B, describing it as indentured servitude has always struck me as hyperbolic.
The situation could be easier, make approved I140s portable and issue an EAD, but you aren't trapped with an employer.
Maybe a little hyperbolic, but the point is that it adds an additional significant shackle.
If I decide my company treats me like crap, I can apply to any* job in the US that I'm qualified for.
If an H1B feels the same way, they need to search within a smaller subset of jobs that are willing to do that paperwork. Last time I was hiring (2025) we were not open to sponsoring H1Bs or green cards. It's just a lot of extra work and legal expense, and frankly we found plenty of talented developers so we were right to not do it. Tons of employers don't deal with it.
* Note: Adjust this figure down somewhat to reflect the fake job postings that I never had a shot at, because the employer is just pretending to look for domestic candidates to satisfy H1B or PERM requirements.
The green card process is not transferable. Once its started the applicant is stuck. I personally saw the company slow roll the process for one of my directs. I kept hassling them to move it along but to no avail. I saw this happen to colleagues at numerous companies.