They are far less stabbable than most. 5th level wizard is going to have 22 hp. A standard noble according to the MM has.... 9 hp. So the wizard is already rocking double the hp of most nobles in the game.
Now, sure, it could be that we should assume the king is a fighter, but a 5th level fighter is looking at only 34 hp. But, um, Assassins are frickin' scary. The assassin can dish out, with surprise and no poison, dish out 42 damage. Feel free to add another 48 damage for the poison. By this point being a wizard or a fighter doesn't matter right?
Except the wizard is armored, and the fighter isn't (Mage Armor). The wizard is awake, and the fighter isn't (alarm spell), the wizard can cast shield, because they are awake, the fighter can't. The Wizard isn't getting auto-critted or hit with sneak attack because they aren't surprised, reducing the damage to 12 normally and 48 from poison. The Wizard can cast spells to increase their defenses still more or escape, or capture the assassin, the fighter can't.
Really weird to say the fighter is less stabbable, when they seem far more vulnerable to the assassin.
Oh, and the spellcaster doesn't have to be a wizard, giving us clerics or warlocks or bards, all of which can be more heavily armored and have more hp. Or be a paladin, and have the same hp, armor and weapons AND magic.
And finally, if we SOMEHOW must have the character be 12th level to be allowed to rule a nation, then the spellcaster is at an even bigger advantage, because it is no more difficult to level as a caster than it is as a fighter, and magic will be even more powerful by that point.
Everyone can be assassinated. Those with access to magic are LESS likely to be assassinated, because magic offers solutions to those problems.