I think it was some dragon-like thing in some cave?
Is not that you can't hit him. Is just that the Crag Linnorm requires cold iron, his weaknesses to be defeated. This is very common not only in D&D/PF. In Daggerfall, if you don't have at least "silver" weapons, forget damaging any ghost, vampire and so on and yes, this applies if the pc becomes a vampire. In D&D 5e, you can ""kill"" ghosts with regular swords.
And why don't the stronger monsters obliterate entire towns on a regular basis?
In Menzoberranzar, they explain. Wealthy cities can afford good protection, but if a tinny poor village is raided by a drow party, no one will gonna send people to rescue the slaves. You are assuming that there are only powerful monsters but not powerful humans. In Dark Sun, every single one of the Sorcerer Kings is epic level defier/psionicist. Borys is a 30th level multiclass and he has lots of templars in "teen levels"(13+). Low level people who tries to create their cities to escape Sorcerer King Tyranny end up being destroyed quickly and everyone killed or enslaved if they are lucky to find a water source.
In old school D&D, was common that high level individuals get nobility titles and the duty to protect an area. This is somehow represented in stronghold quests in BG2:SoA. Some modules like Test of Warlords(lv 15+) is all about it. Getting lands and having to protect it and deal with all problems. And in Kingmaker, monsters do destroy the kingdom, many kingdoms got destroyed in Stolen Lands.
Those are video games, filled with trash mobs that inflate your EXP gains.
Yet the adventure path is similar to the P&P in adventures/level, second book = second chapter of the crpg, third book = third chapter.
Obviously playing the second book in P&P takes much more time than the second book in the CRPG as you have to do all the math, organize a group and so on. But playing "Varnhold Vanishing" in CRPG or in P&P should start at around lv 7 and go around lv 10.
having solved many a mystery and slain many a mighty foe.
A might foe like a ogre, a troll chieftain, a necromancer with a couple of low level undeads, not a ancient vampire, not a ancient dragon or similar creatures and a freaking Deity avatar should be far above this creatures.
If the game really needs to have an Avatar or Myrkul defeated, forging a alliance and investigating ways to weaken him before fighting him would be a better choice on how to deliver it. If when he appeared, he is so powerful that you can't do shit, then you run and try to find a way to weaken him. That would make much more sense.