Give them a time limit to accomplish a quest. Resting takes time. If they are in a dungeon crawl, make resting dangerous unless they retreat to the secure area, then during their rest allow the inhabitants to respond, rearm traps, call in favors from distant friends. If one of the hobgoblins they are fighting is owed a favor by a nearby chief or a powerful bugbear barbarin, he might just call it in and make things that much harder for the PCs.