joker in the deck, a

joker in the deck, a

Any item or device, such as a clause in a contract, that unexpectedly changes the nature of something, either for better or for worse. The noun “joker” alone has been used in this way since the mid-1800s, as in “The postal rate increase had within it a joker that would hurt nonprofit organizations.” Today the term, also put as joker in the pack, sometimes refers to a person whose behavior is unexpected on unpredictable.
See also: joker