A garrison was a military or fortified post occupied by soldiers. Related Hebrew terms may also refer to a station, an officer or prefect, or a monumental pillar, so not every Authorized Version occurrence necessarily means a military post.
The biblical passages use the term chiefly for military stations or posts held by soldiers. In one passage the related word is better understood as pillars or obelisks rather than garrisons.
The underlying words derive from a root meaning to place or erect. The sources note that this root could be applied to several kinds of objects or positions.