A "pickle" is a rundown.
William Shakespeare is thought to be the first to use the idiom "in a pickle" in The Tempest. But he gave it a somewhat different meaning -- in England, "pickle" actually refers to something close to relish, and one is "in a pickle" if they're inebriated.
But the metaphor got simplified after the phrase came to America. "In a pickle" came to mean "in a tough spot" -- much like a cucumber, stuck sitting in vinegary brine for days on end.