12 Then David knew that the LORD had established him as king over Israel and had exalted his kingdom for the sake of his people Israel.

Read 2 Samuel 5:12 Using Other Translations

And David perceived that the LORD had established him king over Israel, and that he had exalted his kingdom for his people Israel's sake.
And David knew that the LORD had established him king over Israel, and that he had exalted his kingdom for the sake of his people Israel.
And David realized that the LORD had confirmed him as king over Israel and had blessed his kingdom for the sake of his people Israel.