The joke is a pun.  'Knead' means to pound or press the dough for making bread.  'Knead' sounds like 'need' which would make the phrase 'need to know basis', and that generally means 'only told to those who have to know'.
Bakers trade bread recipes on a knead to know basis .