The ghoul was originally a monster of the Arabian desert (Arabic ghūl) said to dig up graves and devour the dead. That folklore was absorbed by Lovecraft, who in tales like "Pickman’s Model" recast it as a doglike, corpse-feeding species dwelling underground, and along that lineage it settled into tabletop role-playing as an undead.
This passage — folklore to cosmic horror to dungeon — itself shows that dungeon fantasy and the Lovecraftian tradition branched from a single root.