The patisianship in government came about because of three primary events. The first was a good idea to create the civil service to protect government employees when President’s changed but that with the advent of unions protected incompetence employees and made it almost impossible to fire them. The third was the growth of big government and the number of employees and their interests of growing government even larger through regulations.
The fourth is allowing government unions. Government employee unions and employees contribute the vast majority of their donations to the Dems.