We skip over a lot of twists and turns in the saga of David succeeding Saul as King of Israel. During the transition, David was at pains several times to prove he would not hesitate to execute those whose sins threatened the nation’s shalom, but was careful not to harm anyone who was peaceful with him. So while David did go to war against Saul’s surviving heirs, he treated the deaths of Ishbaal and Abner as murders. He even cursed his own cousin and commander of troops, Joab, for taking senseless revenge on Abner.
There are a few background items we need to understand. The nation had already been long divided between Israel in the north and Judah in the south. The division is not easily explained, and some of the critical events that contributed to it are not very well covered in Scripture. But very early in the Book of Judges it was readily apparent that the north clung to the leadership of the Tribe of Ephraim, despite Judah being clearly pegged as the royal tribe by Israel himself. Saul’s Tribe of Benjamin had a tendency to ride the fence, which helps to explain how Saul was chosen as the first king.
Eventually Benjamin is associated with the south. Still, David had to wait for the final capitulation of Saul’s heirs, and the northern tribes, before he could move on Jerusalem, because that city was actually in Benjamin’s tribal allotment. The right of conquest makes it the royal city.
During Joshua’s Conquest, the City of Jebus (AKA Jerusalem) was taken and occupied, but the old Jebusite fortress on the lower ridge below Mount Moriah’s peak remained independent. The city itself was spread out on the western hill beyond what is now called the Tyropoean Valley. North of the fort was an open space which had been sacred for centuries — Mount Moriah (where Abraham prepared to offer Isaac). We have no solid identification for who lived there. Our best guess is some Amorite types who were either Hurrian, or highly influenced by them. The few surviving names from the Jebusites seem to celebrate Hurrian deities. The folks inside were likely a single extended noble family household.
When David came to lay siege to the fort, the defenders made the boast that even the lame and blind of their inhabitants could fend off the attack, since the place was so very well protected naturally. The southern end and both sides were steep bluffs, and the northern end was a very thick fortress wall. That thick stone barrier eventually became a terrace wall to expand the Temple site.
One of the reasons the fortress could withstand a long siege was that they had dug a slender conduit down to the pooled water of the Gihon Spring. It was a natural spring with a low flow rate, and it had long ago been dug out and expose a substantial underground pool at the source. Anyone outside the wall could access the pool by the very ancient opening, and it wasn’t very far. But off the other side of that underground pool was another, newer conduit that was much longer and climbed up a shaft into the courtyard of the fort. So several of David’s men managed to strip down to the essentials and shimmy through it. These would have been his ultimate warrior champion types, able to climb up the well shaft into the fortress and fight off the defenders well enough to bring in a squad that could force the gates open.
Keep in mind that everyone was still using mostly bronze weapons, relatively small and brittle, and good leather armor was pretty effective. Athletic men with good hand-to-hand skills could survive quite a while in a small space like the fortress courtyard, and may not have been noticed for a while. There weren’t likely more than a couple dozen Jebusite warriors in the entire fortress, with a few others playing soldier during the siege. It wasn’t a slaughter; the Jebusites surrendered and became resident aliens with low status.
David makes a taunt of their boast, referring to the Jebusites as “lame and blind” altogether, since they couldn’t defend their fortress from him. It became a nickname for Jebusites, whose survivors were never allowed back into David’s new capital, called Zion or the City of David. David expanded the old fortress to cover the entire ridge top, and it was treated as his palace. You should not read the text as David actually hating people who were blind and lame, since he eventually welcomed the last survivor of Saul’s household, the lame Mephibaal, as family.
To help David celebrate his accession to the throne, the Philistines attacked twice more, seeking to maintain the feudal dominance they had just won a few years before. David defeated them both times, being careful to inquire of the Lord each time whether he should go, and how to do it. These were attacks directly on Jerusalem, because the Valley of Giants (Valley of Rephaim) winds around and right up close to the city. The first attack strikes them on the flank. In the second instance, the Lord advised David to come around below them in the valley, wait for a divine signal, and attack from the rear.
David quickly established himself as a worthy king. The people were moved to follow him without dissent.
Note: The names were Ishbaal and Mephibaal, but later copies were made by zealots who changed the “-baal” part to the Hebrew word for “shameful” — bosheth. We have solid evidence that manuscript copyists made those changes during a time when a certain kind of political correctness had risen in the priestly ranks, and they were the primary librarians at the time. Anything that smacked of the ancient Canaanite pagan idolatries was treated with an almost comical spite, so that even Ashtarte became “Ashbosheth.”