[1 Samuel 16:13] 13 Then Samuel took the horn of oil and anointed him in the midst of his brothers; and the Spirit of the LORD came mightily upon David from that day forward. The moment David was anointed with oil, according to God’s instructions, the Holy Spirit mightily came upon the future king. In God’s Kingdom time is nonexistent; David in that sense is already king, but it took almost 20 years before David actually took up his throne as king of Israel.

Priests had anointed kings. [1 Kings 1:39] Zadok the priest then took the horn of oil from the tent and anointed Solomon. Then they blew the trumpet, and all the people said, “Long live King Solomon!”

The prophet Elijah, was also told to anoint a new king and another prophet in his place.

[1 Kings 19:15-16] The LORD said to him, “Go, return on your way to the wilderness of Damascus, and when you have arrived, you shall anoint Hazael king over Aram; [16] and Jehu the son of Nimshi you shall anoint king over Israel; and Elisha the son of Shaphat of Abel-meholah you shall anoint as prophet in your place.

[2 Kings 9:1-3] Now Elisha the prophet called one of the sons of the prophets and said to him, “Gird up your loins, and take this flask of oil in your hand and go to Ramoth-gilead. [2] When you arrive there, search out Jehu the son of Jehoshaphat the son of Nimshi, and go in and bid him arise from among his brothers, and bring him to an inner room. 3 Then take the flask of oil and pour it on his head and say, ‘Thus says the LORD, “I have anointed you king over Israel.”’ Then open the door and flee and do not wait.”

Even though prophets and priests anoint kings later they may be subject to those kingly authorities themselves; an example of this taking place we find in the event with Elijah when ran away from death threats issued by Ahab’s wife, Jezebel the queen of Israel (1 Kings 19:1-9). To better understand it read Romans 13:1 where Paul states that God establishes all authorities and governments, not man, but the ultimate authority.