"In memoriam -- our civil service as it was", Thomas Nast (Harper's Weekly, 1877. via Wikipedia)

Prior to Andrew Jackson’s presidency, each newly elected president had been rather circumspect regarding the transfer of power from one administration to the next. Andrew Jackson changed that in a big way. An office-seeking horde descended upon Andrew Jackson’s inauguration after Jackson had promised friends, allies and cronies alike positions within his new administration. The new process of appointing people due to political ties rather than competence represented a marked change from the past in the 1830s. This new Jacksonian system, the Spoils System derives from a quote by the Jacksonian Democratic Senator William L. Marcy of New York: “To the victor belong the spoils.” The system remained in place until the 1860s, when the public began to demand an increasingly large number of civil services to be administered by the federal government. The system did not end, however, until the Pendleton Act passed in 1883, however, which established a bipartisan board that would select applicants for work within the government. Later, the Hatch Act of 1939 prevented government employees from taking part in many political activities.

Wikipedia: Spoils System