edit: What Shades of Green said. Of sufficient level that the number deployed to guard a place can overcome the creatures expected to attack it. If the town or city can't recruit guards of that strength, it would already have been sacked and abandoned.
Towns that don't expect any monsters to attack only need guard details and watch patrols that can arrest a typical citizen (CR less than 1), so 1st level guards and some higher-level leaders might suffice. If monsters live nearby, the place needs guards of a CR no less than, say, 2 below the monsters.
Adventures happen when the balance shifts: the town suffers a disaster or distraction, reducing the numbers of its protectors, or powerful enemies arrive unexpectedly from somewhere else.
Towns that don't expect any monsters to attack only need guard details and watch patrols that can arrest a typical citizen (CR less than 1), so 1st level guards and some higher-level leaders might suffice. If monsters live nearby, the place needs guards of a CR no less than, say, 2 below the monsters.
Adventures happen when the balance shifts: the town suffers a disaster or distraction, reducing the numbers of its protectors, or powerful enemies arrive unexpectedly from somewhere else.