Also is the word here really "illegal" or more like a breach of contract? I am not saying doing the opposite of what you signed is legal per-se, my point is that I am not sure if there are actual written laws saying you can't poach.
At least in my experience people agree to that, and it's usually when exiting a company, not when joining. As in "you agree not to initiate poaching up until 12 months after leaving the company".