David, the youngest of his family, had been chosen to be King. During his reign, he had unified his people, and brought peace. His story had begun with his willingness to take up arms against a formidable opponent and then even against his king. His personal life was troubled. He had committed adultery; his children fought among themselves (1 and 2 Samuel). He spent his final years in weakness. As he lay dying his sons argued over succession. David named Solomon, Bathsheba's son, over Adonijah, the eldest son (1 Kings 1).
David had reigned a long time, but his reign ended. A successor had to be chosen. Not everyone agreed.
Kingdoms, companies, clubs, and churches have to go through transition. Following a strong leader can be hard.