Cities are large-scale settlements, and people originally formed settlements to fight against nature. After the settlement was re-formed, economy and class appeared, so internal development and struggle replaced external defense. In other words, the military use of settlements has gradually become auxiliary.
The pass was built to supplement the city's missing defense forces, so it was originally for purely military purposes. When cities within a country do not have sufficient defense capabilities, they need to keep the enemy out of the country. This pass is used to stop the enemy. This is not to defend a city. Generally speaking, the fall of the pass means the opening of the country. From a strategic point of view, the Pass is far more important than ideal city.
However, the usual pass will also be changed for some reasons. For example, the national policy of "mutual market", at this time, the pass also has some commercial purposes, and for example, some garrison commanders gather border people to build a city, at this time, the pass has also become a part of the city.
At the same time, some border towns will also increase their military use, such as Jiubian Town in Ming Dynasty and Liuzhen Town in Northern Wei Dynasty.
Once the enemy begins to attack the city, it is basically a pass, and the pass is basically a border pass. However, it is not necessary to solve the key problems when entering the customs. For example, Wargo sneaked into Chengdu in the surprise attack of level tone.