After conquering the fortress of Zion, David transforms it into his permanent royal residence and the heart of his government [מלבי"ם, רלב"ג]. To secure and establish the newly captured capital, he launches an extensive campaign of building and fortification, expanding the city's development inward toward its center [מצודת ציון, רד"ק, אברבנאל].
The exact nature of this initial construction project is understood in a few distinct ways. One perspective suggests the focus was a large public square. In this view, David intentionally left an open area near the city wall for public gatherings and assemblies, building the city's houses from that point inward to ensure the outer plaza remained clear [מלבי"ם, מצודת דוד, רד"ק]. Another approach views the project as a massive landscaping and earthwork effort. This involved either constructing a low earthen wall with sloping sides to support a ring of new houses around the fortress [רש"י], or building an earthen rampart to fill in the low valley that separated the fortress from the rest of the city, thereby uniting the distinct sections and expanding the overall urban footprint [ביאור שטיינזלץ].
A third, strictly military interpretation suggests the construction was a defensive water trench. According to this view, David dug a deep, wide moat around the city and filled it with water to prevent enemy forces from penetrating the capital. Just inside this protective water barrier, he then constructed a towering and robust defensive wall to further secure the city [רלב"ג, אברבנאל].