I agree with the general gist out there, but there are sane non competes. To take the one example I'm intimately familiar with, here in the Netherlands it's common for agencies to "rent out" some or all of their employees to work directly at customers (formally called secondment but I'm not sure that's a common term anywhere). This is because Dutch employment laws make firing someone hard, but terminating a secondment contract is easy. So it brings flexibility, plus the agencies are typically good at recruitment. Many tech companies's engineers have a huge chunk of their engineering teams be seconded via agencies.
Those agencies typically have a non-compete which, if it's the Good Kind Of Non-Compete, disallows employees who quit to take a job at the company they were last seconded to. This means that you can't, on paper, quit the agency to work directly for the company you were already working at via the agency.
In practice this works out fine, because the agency adds two values: flexibility and recruitment. What happens in practice is that if a company wants to take you over (a bit like buying a top sports player maybe), then the customer has to negotiate with the agency for some sort of buy-off fee. They tend to come to a sensible agreement fast, because the job market is great and if Joe Employee just was told he can't get his dream job because his current employer pulled a legal trick, he's not gonna want to keep working for the screwover employer long. So there's an incentive for the agency to make the deal.
There's also plenty evil non-competes here btw. Like "you can't ever work in our industry anymore" or "you can't ever work for any of our customers (and oh by the way all tech companies in the area are a customer haha lol)", etc.