Long before refrigeration, North American farmers kept supplies of salt pork stored in barrels, and the amount of meat on hand indicated the family’s prosperity.
If the barrel was low on pork, it meant the possibility of disaster through starvation.
When a politician sought and gained favoritism for his constituents, he was said to have filled the pork barrels of those who had elected him, thereby assuring his re-election.
And that’s why political favoritism is called “pork barrel politics”.