Do you know ghouls from goblins and ghosts?
"dirty," by 1845, from grub (n.) in a sense of "dirty child" (who presumably got that way from digging in earth) + -y (2). Earlier it was used in a sense of "stunted, dwarfish" (1610s) and "infested with grubs" (1725). Related: Grubbily; grubbiness.
Not clean; dirty: grubby kid