There are several ways to achieve this (plain old regulation being one of those tools), but allowing people to freely associate without that association being the reason to fire them seems like another pretty obvious and great tool.
I don’t really understand why the vision of companies as empires with absolute monarchs seems so appealing to people. That seems like a disgusting vision to me that we should strive to avoid. Since people aren’t machines.