1Of a military position or force: securely defended by a trench or trenches; well dug-in; (more generally) well-defended against attack.
2Firmly established; difficult to challenge or dislodge; (hence) unlikely to change.
Originally as part of an extended metaphor.
Late 16th century; earliest use found in William Garrard (d. 1587). From well + entrenched.