The spoils system, in which political leaders give out jobs to their loyal supporters after entering office, has the benefit of ensuring enthusiastic support through the election, but it has the drawback of questionable qualifications for appointees. This system has been in place for centuries, in one form or another.
The term "spoils system" dates back to 1832, when Henry Clay complained about the ways in which President Andrew Jackson had swept many political appointees out of office with his own cronies after entering the White House. One of Jackson's allies, Sen. Marcy from New York, responded to these complaints by saying that there was nothing wrong in the rule that to the victors belong the spoils.
One historical, hazardous disadvantage of the spoils system was President Garfield's assassination by Charles Guiteau. Guiteau was a disgruntled person who wanted a government job and knew that President Garfield's successor, Chester Arthur, belonged to the wing of the Democratic Party with which Guiteau had pledged his loyalty. This assassination led to an act that created the civil servant position, a group of federal workers who would be hired on the basis of merit rather than political whim.
Even so, elements of the spoils system remain in modern times. President Obama received criticism for appointing ambassadors to countries on the basis of loyalty and fundraising rather than qualifications. When former Senator Max Baucus was named ambassador to China, he pointed out that he was not a real expert on China at his confirmation hearing but ended up in the position anyway.