The first two kings, Saul of the tribe of Benjamin, and David of the tribe of Judah, were both anointed by Samuel, who acted as judge and prophet through the transitory period to monarchy.
Israel’s demand for a king and Samuel’s response is documented: 1 Samuel 8:1-22 And it came to pass, when Samuel was old, that he made his sons judges over Israel. Now the name of his firstborn was Joel; and the name of his second, Abiah: they were judges in Beer-sheba. And his sons walked not in his ways, but turned aside after lucre, and took bribes, and perverted judgment. Then all the elders of Israel gathered themselves together, and came to Samuel unto Ramah, And said unto him, Behold, thou art old, and thy sons walk not in thy ways: now make us a king to judge us like all the nations.
But the thing displeased Samuel, when they said, Give us a king to judge us. And Samuel prayed unto the LORD. And the LORD said unto Samuel, Hearken unto the voice of the people in all that they say unto thee: for they have not rejected thee, but they have rejected me, that I should not reign over them.
According to all the works which they have done since the day that I brought them up out of Egypt even unto this day, wherewith they have forsaken me, and served other gods, so do they also unto thee.
Now therefore hearken unto their voice: howbeit yet protest solemnly unto them, and shew them the manner of the king that shall reign over them. And Samuel told all the words of the LORD unto the people that asked of him a king.
And he said, This will be the manner of the king that shall reign over you: He will take your sons, and appoint them for himself, for his chariots, and to be his horsemen; and some shall run before his chariots.
And he will appoint him captains over thousands, and captains over fifties; and will set them to ear his ground, and to reap his harvest, and to make his instruments of war, and instruments of his chariots.
And he will take your daughters to be confectionaries, and to be cooks, and to be bakers. And he will take your fields, and your vineyards, and your oliveyards, even the best of them, and give them to his servants.
And he will take the tenth of your seed, and of your vineyards, and give to his officers, and to his servants. And he will take your menservants, and your maidservants, and your goodliest young men, and your asses, and put them to his work.
He will take the tenth of your sheep: and ye shall be his servants. And ye shall cry out in that day because of your king which ye shall have chosen you; and the LORD will not hear you in that day.
Nevertheless the people refused to obey the voice of Samuel; and they said, Nay; but we will have a king over us; That we also may be like all the nations; and that our king may judge us, and go out before us, and fight our battles.
And Samuel heard all the words of the people, and he rehearsed them in the ears of the LORD. And the LORD said to Samuel, Hearken unto their voice, and make them a king. And Samuel said unto the men of Israel, Go ye every man unto his city.
The choice of Saul by God, followed by his identification by Samuel and his presentation to the tribes is detailed in 1 Samuel 10-11.
Saul’s subsequent failures as king, lead to his rejection by God and Samuel was instructed to anoint David as king (1 Samuel 16), although David did not take up this role until after the death of both Samuel and Saul. The Davidic dynasty continued throughout the monarchical line of the kingdom of Judah until Zedekiah, Judah’s final king when the nation fell to the Babylonian captivity.