Entrenching refers to units making use of their surroundings to create fortified positions. Any stationary unit without an order will begin to entrench. When a unit moves their entrenchment is lost. Entrenchment provides a bonus in combat.
Units given an order to entrench in any facility (base or industry) will garrison the facility. Their picture is removed from the map and their hud is placed on the facility. Units in Garrison will get a defensive bonus in certain facilities and will always get an increase in stealth strength. Garrison units will ungarrison to engage in combat and return to garrison when they stop firing.
If you wish a unit to be placed in garrison at a location without a facility, simply build an emplacement. These have no staff or maintenance cost but will allow you to garrison the location. Units fighting from an emplacement use close combat and receive a bonus to indirect defense.