On the surface, this phrase refers to the city buildings that are very close together. As a city surrounded by mountains, Jerusalem was much more densely populated than other cities and as a result it had a striking physical appearance.1
Given the context of this verse, it could also refer to the unity of God’s people that is evident in Jerusalem. After describing the nature of the city (closely compacted together) the psalmist immediately talks about the twelve tribes who come to the city.
3 Jerusalem built as a city that is bound firmly together,