I believe dos mom does this too. When one new citizen is created, that citizen starts out as a worker unless there are not enough farmers to support the food needs of that specific city where the population growth occurred. If there is a deficit in the required farmers to support the new population then the new citizen automatically becomes a farmer.
None of this takes the food needs of the army as a whole into account. You have to manually rebalance the farmers across your empire to sustain the army's food needs. But the game will warn you when your army food needs becomes negative.