That a contract has been drafted and signed, even in good faith, is only half the battle. It must also be enforced. The court can simply ignore some or all of a contract which is obviously unfair or exploitative to either party. Centuries of legislation and case law go into determining what sorts of clauses are, in fact, enforceable.
This is why you need a lawyer to draft a contract, and cannot just write whatever on a piece of paper and sign it. Even lawyers overreach, however; it's part of their job.