In the 19th century, cooks on ships used salt pork as a key ingredient for many meals because it kept well for long periods of time. When cooked, however, it produced large quantities of grease. The grease was then sold when the ship reached port, and the money used to buy small luxury items for the crew. This grease was called slush.
The author William McNally didn’t think much of the practice and included a description of it in Evils & Abuses in Naval & Merchant Service, 1839:
The sailors in the navy are allowed salt beef. From this provision, when cooked nearly all the fat boils off; this is carefully skimmed and put into empty beef or pork barrels, and sold, and the money so received is called the slush fund.
In the same year, The Army and Navy Chronicle suggested that a ship’s slush fund would be a suitable source of money to buy books for the crew:
To give men the use of such books as would best suit their taste, would be to appropriate what is their own, (viz.) the slush fund for the purchase of such works.
This is the beginning of the meaning we now have for ‘slush fund’, that is, money put aside to make use of when required. Today, the phrase is often used to refer to money used for bribery, political pressure, or other corrupt purposes, or to unrestricted money obtained from a variety of sources.