Comment by hluska
Consider contract employment. You agree to work for me for x months. In exchange, I agree to pay you $y. The contract outlines reasons that I can fire you and reasons that you can quit. And, if either party violates the terms of the agreement, we can go to court.
Well, to be exact, you can always go to court and dispute the termination is illegal.