The American employment-at-will rule was developed in the 19th Century. It was a departure from the English common law rule that all employment of an indefinite nature was for one year, with each subsequent renewal also considered to be of one year's duration. The American rule instead viewed all employments of no definite period to be terminable at any time by either party. The basic rule was simply stated in the most quoted late-19th century case of Payne v. Western & Atl. R.R.:
(M)en must be left, without Interference to buy and sell where they please, and to discharge or retain employees at will for good cause or for no cause, or even for bad cause without thereby being guilty of an unlawful act per se. It is a right which an employee may exercise in the same way, to the same extent, for the same cause or want of cause as the employer. 
The employment-at-will rule became commonly known as "Wood's Rule", based on a 1877 treatise on master-servant relationships by Horace Wood. Wood provided a firm rule for all indefinite hirings which became the fundamental doctrine governing employment duration in the United States:
With us the rule is inflexible that a general or indefinite hiring is prima facie a hiring at will, and if the servant seeks to make it out a yearly hiring, the burden is upon him to establish it by proof. A hiring at so much a day, week, month, or year, no time being specified, is an indefinite hiring, and no presumption attaches that it was for a day even, but only at the rates fixed for whatever time the party may serve. 
Many explanations have been given for the adoption of the employment-at-will rule, from its being a reflection of the needs of late 19th century capitalism and laissez fairs economics to being a natural complement to the principle of freedom of contract.  Whatever the socio-politics, the consequence was clear. The employment relationship was to be established and governed exclusively by the will of the contracting parties, not by the will of the general public and its judicial and administrative mechanisms.
Employment-at-will struck a perfect balance. The parties could specify employment conditions and duration by explicit contract, which would then be enforceable in court. Without explicit contractual language specifying otherwise, an employer could terminate the employee at any time and an employee could leave the job at any time, without legal encumbrances. Employers had the flexibility to hire whomever they deemed most appropriate, and employees had the flexibility to seek more favorable employment.
Employment-at-will even achieved constitutional weight. In Adair v. United States, the United States Supreme Court in 1908 related liberty of contract and the Fifth Amendment to the employment contract by striking down a federal statute which barred the discharge of a railroad employee for union membership.  Seven years later, in Coppage v. Kansas, the Court struck down a Kansas statute which prohibited employers from demanding, as a condition of employment, that employees not become union members. The Court found that the statute was a violation of the 14th Amendment due process clause. The Court related due process to the employer's right to determine whom to hire.  With the U.S. Supreme Court thus constitutionally sanctioning the basic underpinnings for employment-at-will, the American rule achieved a common law dominance which it was to maintain deep into this century.
The solid wall of employment-at-will first started to crack in the 1930s, when the U.S. Supreme Court in effect removed the constitutional underpinnings of employment-at-will with the approval of the National Labor Relations Act in NLRB v. Jones & Laughlin Steel Corp.  This pathbreaking Act forbade employer discrimination against or coercion of employees because of union activity. Thus began the long and still-ongoing process of statutory exceptions to the employment-at-will rule. The Supreme Court was careful to note that the exception provided by the Act was very limited, permitting employer discharge in all other circumstances. In a related case, Associated Press v. NLRB, the Court went out of its way to emphasize the limited nature of the National Labor Relations Act exception:
The act does not compel the petitioner (employer) to employ anyone; it does not require that the petitioner retain in its employ an incompetent editor or one who fails faithfully to edit the news to reflect the facts without bias or prejudice. The act permits a discharge for any reason other than union activity or agitation for collective bargaining with employees. The restoration of (the terminated employee) to his former position in no sense guarantees his continuance in petitioner's employ. The petitioner is at liberty, whenever occasion may arise, to exercise its undoubted right to sever his relationship for any cause that seems to it proper save only as a punishment for, or discouragement of, such activities as the act declares permissible. 
Employment-at-will was thus still very much alive. The common law still recognized as equal the rights to hire/fire and to work/resign. These balanced rights were limited only by specific statutory exceptions. Nevertheless, the previously solid wall had suffered its first substantial crack, creating an opening for the federal Congress and state legislatures to impose their will and sense of proper behavior on the employment relationship.
Today, federal and state statutory law is filled with explicit exceptions to the employment-at-will rule. At the federal level, examples include the Fair Labor Standards Act, which prohibits discharge for exercising rights guaranteed by minimum wage and overtime provisions.  The Occupational Safety and Health Act of 1970 prohibits discharge in reprisal for pursuing safety hazards in the workplace.  Numerous federal statutes prohibit termination for exercising specific rights granted by those particular statutes. The most significant federal statutes limiting the right to discharge focus on the public policy against discrimination. The Civil Rights Act of 1964 prohibits discharge based on race, color, religion, sex or national origin and reprisal for exercising rights under the Act.  Similar provisions prohibit discharge under the Age Discrimination in Employment Act of 1967  and the new Disabled Americans Act of 1990. 
Most states have also passed statutory limitations on the employer's right to hire and fire. Michigan has been particularly active in this regard, passing a state version prohibiting discrimination (with the inclusion of additional protected categories such as marital status, weight and height), a very strict affirmative action handicapper discrimination act (which also goes beyond the federal statute), a state payment of wages prescription, an act providing complete employee access to his files, a polygraph protection act, and a whistleblowers' protection act. 
Significant about these statutory proscriptions and prescriptions is their limited nature. Even such far reaching statutes as the federal and state civil rights acts still are explicit and focused in their limitations to the employer's right to hire and fire at will. They are the product of extensive public debate and reflect a broad public consensus, as opposed to the opinions of a few individuals sitting as judge or jury. We can look at each statute and know specifically what is permitted or prohibited. In a sense, the passage of statutory limitations on freedom of the employment contract acts as a reaffirmation of the common law employment-at-will rule.
But such is not the case with judicial Intervention. The real damage to employment-at-will has been committed to date through the intervention of liberal activist judges who think they know what is best for the parties In the otherwise private employment setting. Employment-at-will is in decline as the result of an ever-expanding array of theories based on "public policy" and implied contract.