A jam that may have onions in it! (6)
I believe the answer is:
pickle
'a jam' is the definition.
(I know that jam can be written as pickle)
I don't understand how the remainder of the clue works.
Can you help me to learn more?
(Other definitions for pickle that I've seen before include "A preserved vegetable or a fine mess" , "Relish; tricky situation" , "Jam - vegetables preserved in vinegar or brine" , "Preserve; muddle" , "Relish; predicament" .)