The thing about a contract is that its power comes from the fact that somebody agreed to be bound by it. In legalese, this is "informed consent." An old joke among lawyers (of which I still am not one) is that an oral contract is worth the paper it's printed on, which is just another way of saying that going to court without any evidence is a tough sell.
Although many different forms of agreement might technically be considered legally binding (including "handshake" deals), if you wind up having to sue somebody in court to enforce the thing it's very difficult to prove what the exact terms were, or even that the contract was agreed to in the first place, without some kind of record of the agreement. If you get to the point where you're suing someone to enforce the terms of a contract, there's just a possibility they may dispute what you have to say in the matter. Documentation to back up your claims really comes in handy, especially if you wind up needing it.
Signing printed copies of contracts with a pen and ink is the preferred method of recording acceptance of the terms of the contract and a willingness to be bound by them. Variations on this theme include signing and dating the contract with witnesses (especially a "notary public," which is a witness with credentials), faxes of signatures, signatures digitally recorded on electronic writing tablets, and specially prepared ink stamps that stamp out a signature. In theory, writing an "X" on the appropriate line of the contract could be a legally binding signature (which is often the case for illiterate people).
It's not that any of these methods are any more or less legal than another, just how much documentation of the agreement is gathered. The important thing is that if it winds up in court, the record is enough to convince a judge that whoever it was agreed to be bound by the terms of the contract.
Contract law is similar to copyright law in that it has its own set of intricate details about what is and what isn't allowed, and since I glossed over "fair use" a bit when I talked about licensing copyrights there's no WAY I expect to do contract law justice. One rule is that a contract must have well defined limits, such as a defined period of time during which it is valid. Another is that a contract can't force anyone to do something that is otherwise illegal.
Contract law is considerably more powerful than copyright, or at least it has a much wider scope. Copyright licenses can't use copyright law to take away your rights, only to grant you certain new rights (i.e., to copy or use the copyrighted property) with certain types of strings attached. The main enforcement mechanisms copyright law makes available to a copyright holder against someone who violates the terms of the license are the withdrawal of the rights a license grants by the termination of that license, and maybe damages awarded in court for infringing on the copyright without a valid license.
This doesn't mean a copyright license could enforce a "non-compete" clause that says after using someone else's software your company can't create and sell a similar piece of software for the next few years. Once the user has deleted the software, the license is terminated, along with its restrictions and obligations. (The information gained by studying the program cannot be copyrighted, just the actual program, so they can't say "you can read this thing, but you can't act on what you learn." This also runs smack into "fair use." But ask a real lawyer before doing anything stupid anyway.)
What CAN enforce such a non-compete clause is contract law. A signed contract can last for decades, and the terms of the contract can involve an obligation to sacrifice a live chicken every third week if the signer is willing to agree to that (and it's legal in the relevant jurisdiction). If the software company has customers give informed consent to the non-compete clause before they hand over the software, and they can prove that in court (preferably by producing a signed copy of the license), that's probably going to be enforceable.
This is why large companies that license intellectual property to other large companies usually supplement their rights under copyright with signatures on
the licenses, to turn them into signed contracts that have extra teeth under contract law.
Of course, the ultimate way to keep control over intellectual property is to keep it secret. This is what Coca-Cola did with the formula for their flagship beverage. Patents expire into the public domain after a few years, and copyrights regulate documents but not the information they contain. Trademarks only regulate what you can call things. To keep control over the formula for Coke, they simply didn't give it out to anyone who hadn't signed a contract promising to keep it secret.
The problem with secrets is that once they've leaked, there's not much you can do about it. There are various state laws regarding trade secrets and confidential information, mostly formalizing the idea that if you have a contract saying somebody won't give out certain information, and they do, they can be punished for that. Misuse of trade secrets can be handled. But once the information's out in the open, it's not a secret anymore.
Finally, there's bluffing. This happens all the time. During the 1992 presidential campaign, Ross Perot copyrighted his likeness and convinced Dana Carvey to stop parodying him on Saturday Night Live, despite the fact that parody explicitly falls under "fair use" and they had been parodying other copyrighted and trademarked properties (such as Eddie Murphy doing "Gumby" and "Buckwheat") for years. The important thing wasn't whether Perot had a case that would hold up in court, it's that he had a lot of money to spend on lawyers, he sounded serious, and that Dana Carvey backed down.
Lots of software comes with "shrinkwrap licenses" that claim to be contracts as well. They state that by breaking the plastic covering on the box you agree to be bound by their terms. If you haven't read the license yet and don't know you're agreeing to the contract, and a tree falls on it, does it still make a sound? Lots of these "contracts" are inside the box, meaning you had to buy the software before you were told what you were agreeing to (again, not exactly the kind of "informed consent" that makes a contract, in my opinion).
Yet companies have done this for decades. There haven't been a lot of law suits, but the few that there have been have gone both ways. The way I see it, software companies don't want to risk losing, and thus setting a legal precedent that might definitively render shrinkwrap contracts invalid. Yet most people follow their terms anyway out of sheer intimidation, ignorance, or reasonable doubt combined with an unwillingness to go up against an opponent with a lot more money to spend on lawyers.
Law isn't always black and white, or there would be no need for an appeals process. Applying laws to specific situations may require a lot of interpretation, and a large part of the process is getting the other guy to blink first, convincing the judge or jury of your position, negotiating a decent settlement, or just plain taking a position and holding your ground until the other side runs out of time, patience, or money.