The trade secret argument the poster above you alluded to is very unlikely. Usually a competitor is hiring you because you are already somewhat trained and up to speed in their field... and perhaps the competitor can slow your company's operations by hiring you away.
In the end, many companies only pay you what they have to keep their operations stable and feel more than free to pay the very top of management more than what they deserve, and keep those executive compensations while laying off people in operations quite freely when times are bad. Noncompetes only for the company, not the worker, during good times.