I have always understood the word, "grub", as a verb, to mean digging in the earth - possibly with bare hands, or with a bit of wood.
It is, in other words, hard work.

If this is what you have to do in order to either grow things, or to uncover food (truffles, buried nuts, etc.), then that would very easily become transfered as a noun to the food itself.