I agree, but on the other hand I don't think it is a viable long-term strategy to rely on irreplaceable employees.
Not that contractors don't create arcane code, but at least they should feel professionally obliged to leave understandable code behind. They know they'll be leaving, whereas employees can count on being around.
"They know they'll be leaving, whereas employees can count on being around."
I don't agree with that. A lot of employees don't expect to be around that long, because they know that they can get better raises by leaving than by staying.
Also, as the employee's institutional knowledge rises, that employee has a higher likelihood of getting shunted onto "critical" maintenance projects and support, which tends to make them dissatisfied with their work and therefore prefer to leave.
Not that contractors don't create arcane code, but at least they should feel professionally obliged to leave understandable code behind. They know they'll be leaving, whereas employees can count on being around.