"What food did you make?"
In English you can ask "what food", but really you mean "what kind of food". At least some other languages also have special particle meaning "what kind", and the particle "what" cannot be used instead. So it seems to me, in Japanese it is the same: if the question is "what kind/sort/type" you use 何の, and if the question is simply "what" and cannot be replaced by the particle "what kind", then it's 何. For example: "what is your name" -- cannot be replaced with "what kind of your name" -- so it's 何. But "What food do you like" -- can be replaced with "what kind of food do you like" -- so it is 何の. I don't know if it's always the case, probably not, but here it works.
I am not certain either but a look in my Japanese/English dictionary shows:
何 [なに, なん].
1 (P, adj-no, pn) what. 2 なん: (P, pref) how many (followed by a counter). 3 (P, n) you-know-what, that. 4 (P, exp) whatsit, what's the expression, what do you call them. 5 (P, int) what? (expressing surprise). 6 hey! (expressing anger or irritability).
Entry 1 shows that it is a の adjective. So it is being used to join two words together as one thing. Rather than being used as の possesive ('s/of).
この猫 は 黒いです。 This-cat, is black.
これ は 猫 が 黒いです。 This, it is a black cat.
My Japanese is poor sorry if wrong