Enclosing a settlement gets easier as it gets larger. The amount of work is proportional to the perimeter, while the number of people to do the work is proportional to the area. The area is proportional to the square of the perimeter, so the work per person is inversely proportional to the length of the wall.
bluGill|1 month ago
Cities can only pull off a large population if there are a lot of villages growing surplus food (which is not what the village wants - in the medieval world cities were not making luxury goods farmers wanted so farmers would want to work less), and cities needed good bulk transport for all that food. Rome was a massive city in the day with just over a million people - today that is considered a tiny city and there are many much bigger.