Then the people of Judah came, and there they anointed David king over the house of Judah. When they told David, "It was the people of Jabesh-gilead who buried Saul," David sent messengers to the people of Jabesh-gilead, and said to them, "May you be blessed by the Lord, because you showed this loyalty to Saul your lord, and buried him! Now may the Lord show steadfast love and faithfulness to you! And I too will reward you because you have done this thing. Therefore let your hands be strong, and be valiant; for Saul your lord is dead, and the house of Judah has anointed me king over them." (2 Samuel 2:4-7, NRSV)
And the men of Judah came, and there they anointed David king over the house of Judah. And they told David, saying, That the men of Jabeshgilead were they that buried Saul. And David sent messengers unto the men of Jabeshgilead, and said unto them, Blessed be ye of the Lord, that ye have shewed this kindness unto your lord, even unto Saul, and have buried him. And now the Lord shew kindness and truth unto you: and I also will requite you this kindness, because ye have done this thing. Therefore now let your hands be strengthened, and be ye valiant: for your master Saul is dead, and also the house of Judah have anointed me king over them. (2 Samuel 2:4-7, KJV)
Even though David is replacing Saul—and almost fought against him on the side of the Philistines (which is like changing from siding with the X-Men to joining Magneto)—he still thinks its chill for people to be loyal to Saul in certain ways… Huh.
Now Saul had a concubine whose name was Rizpah daughter of Aiah. And Ishbaal said to Abner, "Why have you gone in to my father's concubine?" The words of Ishbaal made Abner very angry; he said, "Am I a dog's head for Judah? Today I keep showing loyalty to the house of your father Saul, to his brothers, and to his friends, and have not given you into the hand of David; and yet you charge me now with a crime concerning this woman. So may God do to Abner and so may he add to it! For just what the Lord has sworn to David, that will I accomplish for him, to transfer the kingdom from the house of Saul, and set up the throne of David over Israel and over Judah, from Dan to Beer-sheba." (2 Samuel 2:7-10, NRSV)
Therefore now let your hands be strengthened, and be ye valiant: for your master Saul is dead, and also the house of Judah have anointed me king over them. But Abner the son of Ner, captain of Saul's host, took Ishbosheth the son of Saul, and brought him over to Mahanaim; and made him king over Gilead, and over the Ashurites, and over Jezreel, and over Ephraim, and over Benjamin, and over all Israel. Ishbosheth Saul's son was forty years old when he began to reign over Israel, and reigned two years. But the house of Judah followed David. (2 Samuel 2:7-10, KJV)
Ishbaal is probably worried that Abner has aspirations to royal power, since he's sleeping with the former concubine of a king. Yeah, that's a thing.
It was told King David, "The Lord has blessed the household of Obed-edom and all that belongs to him, because of the ark of God." So David went and brought up the ark of God from the house of Obed-edom to the city of David with rejoicing; and when those who bore the ark of the Lord had gone six paces, he sacrificed an ox and a fatling. David danced before the Lord with all his might; David was girded with a linen ephod. So David and all the house of Israel brought up the ark of the Lord with shouting, and with the sound of the trumpet. (2 Samuel 6:12-15, NRSV)
And it was told king David, saying, The Lord hath blessed the house of Obededom, and all that pertaineth unto him, because of the ark of God. So David went and brought up the ark of God from the house of Obededom into the city of David with gladness. And it was so, that when they that bare the ark of the Lord had gone six paces, he sacrificed oxen and fatlings. And David danced before the Lord with all his might; and David was girded with a linen ephod. So David and all the house of Israel brought up the ark of the Lord with shouting, and with the sound of the trumpet. (2 Samuel 6:12-15, KJV)
This highlights the mercurial nature of God—he strikes down some people (like Uzzah) at what seems to be random and blesses others, like Obed-Edom. This is probably the moment where David's loyalty to God is both most rewarded and daringly demonstrated in the form of David's dance.
When David came to the summit, where God was worshiped, Hushai the Archite came to meet him with his coat torn and earth on his head. David said to him, "If you go on with me, you will be a burden to me. But if you return to the city and say to Absalom, 'I will be your servant, O king; as I have been your father's servant in time past, so now I will be your servant,' then you will defeat for me the counsel of Ahithophel. The priests Zadok and Abiathar will be with you there. So whatever you hear from the king's house, tell it to the priests Zadok and Abiathar. Their two sons are with them there, Zadok's son Ahimaaz and Abiathar's son Jonathan; and by them you shall report to me everything you hear." So Hushai, David's friend, came into the city, just as Absalom was entering Jerusalem. (2 Samuel 15:32-37, NRSV)
And it came to pass, that when David was come to the top of the mount, where he worshipped God, behold, Hushai the Archite came to meet him with his coat rent, and earth upon his head: Unto whom David said, If thou passest on with me, then thou shalt be a burden unto me: But if thou return to the city, and say unto Absalom, I will be thy servant, O king; as I have been thy father's servant hitherto, so will I now also be thy servant: then mayest thou for me defeat the counsel of Ahithophel. And hast thou not there with thee Zadok and Abiathar the priests? therefore it shall be, that what thing soever thou shalt hear out of the king's house, thou shalt tell it to Zadok and Abiathar the priests. Behold, they have there with them their two sons, Ahimaaz Zadok's son, and Jonathan Abiathar's son; and by them ye shall send unto me every thing that ye can hear. So Hushai David's friend came into the city, and Absalom came into Jerusalem. (2 Samuel 15:32-37, KJV)
These guys are so loyal to David that they'll sneak in and act as spies and be, effectively, disloyal to Absalom. But that seems pretty fair, given the circumstances.
The king said, "And where is your master's son?" Ziba said to the king, "He remains in Jerusalem; for he said, "Today the house of Israel will give me back my grandfather's kingdom." Then the king said to Ziba, "All that belonged to Mephibosheth is now yours." Ziba said, "I do obeisance; let me find favor in your sight, my lord the king." (2 Samuel 16:3-4, NRSV)
And the king said, And where is thy master's son? And Ziba said unto the king, Behold, he abideth at Jerusalem: for he said, To day shall the house of Israel restore me the kingdom of my father. Then said the king to Ziba, Behold, thine are all that pertained unto Mephibosheth. And Ziba said, I humbly beseech thee that I may find grace in thy sight, my lord, O king. (2 Samuel 16:3-4, KJV)
According to Ziba, Mephibosheth is repaying David's kindness with disloyalty. But it turns out that he was probably lying—though Mephibosheth still loses out on retaining his lands.
Then Joab came into the house to the king, and said, "Today you have covered with shame the faces of all your officers who have saved your life today, and the lives of your sons and your daughters, and the lives of your wives and your concubines, for love of those who hate you and for hatred of those who love you. You have made it clear today that commanders and officers are nothing to you; for I perceive that if Absalom were alive and all of us were dead today, then you would be pleased. So go out at once and speak kindly to your servants; for I swear by the Lord, if you do not go, not a man will stay with you this night; and this will be worse for you than any disaster that has come upon you from your youth until now." Then the king got up and took his seat in the gate. The troops were all told, "See, the king is sitting in the gate"; and all the troops came before the king. (2 Samuel 19:5-8, NRSV)
And Joab came into the house to the king, and said, Thou hast shamed this day the faces of all thy servants, which this day have saved thy life, and the lives of thy sons and of thy daughters, and the lives of thy wives, and the lives of thy concubines; in that thou lovest thine enemies, and hatest thy friends. For thou hast declared this day, that thou regardest neither princes nor servants: for this day I perceive, that if Absalom had lived, and all we had died this day, then it had pleased thee well. Now therefore arise, go forth, and speak comfortably unto thy servants: for I swear by the Lord, if thou go not forth, there will not tarry one with thee this night: and that will be worse unto thee than all the evil that befell thee from thy youth until now. Then the king arose, and sat in the gate. And they told unto all the people, saying, Behold, the king doth sit in the gate. And all the people came before the king: for Israel had fled every man to his tent. (2 Samuel 19:5-8, KJV)
Joab—perhaps convincingly—argues that David's love for Absalom is starting to look like disloyalty towards the troops that have protected him. Uh oh.
With the loyal you show yourself loyal; with the blameless you show yourself blameless; with the pure you show yourself pure, and with the crooked you show yourself perverse. You deliver a humble people, but your eyes are upon the haughty to bring them down. Indeed, you are my lamp, O Lord, the Lord lightens my darkness. (2 Samuel 22:26-29, NRSV)
With the merciful thou wilt shew thyself merciful, and with the upright man thou wilt shew thyself upright. With the pure thou wilt shew thyself pure; and with the froward thou wilt shew thyself unsavoury. And the afflicted people thou wilt save: but thine eyes are upon the haughty, that thou mayest bring them down. For thou art my lamp, O Lord: and the Lord will lighten my darkness. (2 Samuel 22:26-29, KJV)
In David's prayer, God turns into a kind of mirror for the devotee. God reflects back your own wickedness—or your own kindness and benevolence.