As a D&D player in the first example, I'd be willing to entertain an explanation along the lines of "the intruder has a high intelligence, understood what the party was doing when they made camp, and knows the parameters of the spell." While it's still DM fiat, it sounds like there's enough...