A Hallow spell (dimensional lock) and a thin lining of lead built into the walls? It would be weird if they didnt have this.
In a world where your rivals can (and obviously do) hire roving bands of murderhobos capable of casting teleportation/ scying/ divination magic let alone having them on staff as permanent retainers, then yes, I would expect anyone capable of forking out the tens of thousands of GP for
walls and hundreds each week maintaining those wallson a keep or similar to have both of those (basic) defences installed.
Even more-so in FR or Greyhawk or Eberron where magic is relatively commonplace (enough that whole battalions of magic users are fielded by kingdoms).
If YOU were building a keep in F/R wouldnt you hire a spellcaster for their professional advice on how to fortify it against magical threats?
Mage: 'We can keep out the enemy army and spies with walls my leige, but anyone with any magic can listen to everything you say, and teleport in here past the walls and murder you with a word'
King: 'Well that sounds pretty messed up! What can be done about it?'
Mage: 'Easy fixed m'lord. You'll need a few hundred gp in lead, an additional 1,000gp for rare herbs, oils and incense, and a freindly 9th level Cleric.'
King: 'Castellan; fetch the High Priest of Lathander. (whispers) also... what is is a level?'
(I dont know why but the Mage was speaking in the voice of Baldric from Blackadder there).
So? They're vulnerable to death by having their head caved in by an axe. Donald Trump is vulnerable to a bullet to the head.
Try it and see what happens. (Dont actually try it!).
In DnD, the King just gets raised. Unless he cant afford a 500gp diamond for some reason. And then he hires NPC murderhobos (presuming he doesnt have any on permanent retainer on staff) to track down the Warlock with (scrying and teleportation magic).
Long story short, King lives, PC Warlock dies. Actions have consequences.