Whens a door not a door

Explain “when is a door not a door”? i know the answer is “when it’s ajar”, but i don’t understand it It means the door is ajar which means “slightly open” and it’s a pun, really, saying that it is a jar like that one of jam. Whens a door not a door