To get workers, a building must have labor access. Once a building has labor access, it can obtain workers from the city-wide labor pool. (It doesn't matter where workers live). If the city has enough workers, all buildings with labor access will be fully staffed. If there are not enough workers, then some buildings will be partially staffed or unstaffed. The Overseer of the Workers can prioritize categories of buildings. Within a category that has some but not enough workers, buildings that have better labor access will be more likely to be staffed.
Each building that needs workers has a labor access level. 0 (the lowest level) indicates that the building does not have access to labor. Anything else indicates that the building has labor access. (I don't know that 0 is the lowest level, but that would be the obvious way to program it.) If the building's labor access level is below a certain moderately low value, it is described as having poor access to workers.
1/16 month (2 game days) is a key interval in the game. (In other places, 1/16 month has been called a "week", "day", "tick", and "production interval".) There are 51 animation ticks every 1/16 month.
For any building other than a tower that has labor access, its labor access level decreases by 1 every 1/16 month. (I don't know that the decrease is 1, but that would be the obvious way to program it.) This occurs 32 ticks after a citizen appears (and, obviously, every 51 ticks thereafter).
Labor access and building staffing is checked every 1/16 month. As determined by Trium3, this occurs 45 ticks after a citizen appears (and, obviously, every 51 ticks thereafter). At this time, the building's animation is (if necessary) turned on or off. (Calling up an Overseer can force the animation to change at other times.)
Any building that needs employees (other than a Caesar III fountain or mission post) that has labor access below a certain moderately high value will send out a citizen (often called a labor-seeker). Each time that its citizen reaches the center of a tile (every 15 ticks), the labor access level is increased by the number of tiles of occupied houses that are within 2 tiles of the citizen. The type of house and the number of residents (if greater than 0) don't matter, only the number of tiles of housing that are adjacent to or almost adjacent to the citizen.
If you haven't read StephAmon's Ambulomancy paper, as described in
Predicting Roaming Walks, then skip this paragraph, since the effect is minor. As determined by Trium3, when a citizen changes from his initial destination mode to random mode, the increase in labor access level is twice the amount that occurs on other tiles. This can occur only in a grounded walk or a blockage-shorted walk. (The increase is labor access level is not doubled when a citizen changes from random mode to go-home destination mode.)
Many (but not all) service-providing walkers (such as priests and fire marshals) also increase the labor access level of their buildings. (My guess is that they increase the labor access level exactly the same as the building's citizen, but I haven't tested it.) If such a service-providing walker goes by sufficient occupied housing, its building may always have good labor access and never send out a citizen again. Buildings that do not have service-providing walkers (such as industrial workshops) and buildings whose service-providing walkers do not recruit labor (such as Pharaoh magistrates) will send out citizens every now and then.
There is a maximum labor access level. A building that reaches that maximum will retain labor access for quite a while even if its citizen (or service-providing walker, if it has one) does not go by housing. After several months, the citizen will be sent out. After a few more months, labor access will be described a poor. Eventually (if nothing increases the labor access level), the building will lose access to labor.
Applying the theory: Let's say that there is a 2-tile wide row of houses, with a road along one side of them that provides labor access to industries. Should the road be adjacent to the houses or separated from them by a row of shrines? The labor access levels of the industrial buildings will increase twice as much if the road is adjacent to the houses, so that would be better if labor access for the industries is marginal. However, if labor access is expected to be good anyway (for example, if all citizens should walk by several tiles of houses on every walk) then having the road separated from the houses by a tile would be OK.
[Corrected over 14 years later: changed "tax collectors" to "Pharaoh magistrates"][This message has been edited by Brugle (edited 08-31-2022 @ 02:31 PM).]