1 Samuel. 8
So all the elders of Israel gathered together and came to Samuel at Ramah. 5 They said to him, “You are old, and your sons do not follow your ways; now appoint a king to lead us, such as all the other nations have.”
6 But when they said, “Give us a king to lead us,” this displeased Samuel; so he prayed to the Lord. 7 And the Lord told him: “Listen to all that the people are saying to you; it is not you they have rejected, but they have rejected me as their king. 8 As they have done from the day I brought them up out of Egypt until this day, forsaking me and serving other gods, so they are doing to you. 9 Now listen to them; but warn them solemnly and let them know what the king who will reign over them will claim as his rights.”
10 Samuel told all the words of the Lord to the people who were asking him for a king. 11 He said, “This is what the king who will reign over you will claim as his rights: He will take your sons and make them serve with his chariots and horses, and they will run in front of his chariots. 12 Some he will assign to be commanders of thousands and commanders of fifties, and others to plow his ground and reap his harvest, and still others to make weapons of war and equipment for his chariots. 13 He will take your daughters to be perfumers and cooks and bakers. 14 He will take the best of your fields and vineyards and olive groves and give them to his attendants. 15 He will take a tenth of your grain and of your vintage and give it to his officials and attendants. 16 Your male and female servants and the best of your cattle[c] and donkeys he will take for his own use. 17 He will take a tenth of your flocks, and you yourselves will become his slaves. 18 When that day comes, you will cry out for relief from the king you have chosen, but the Lord will not answer you in that day.”
19 But the people refused to listen to Samuel. “No!” they said. “We want a king over us. 20 Then we will be like all the other nations, with a king to lead us and to go out before us and fight our battles.”
1 Samuel 10
Samuel summoned the people of Israel to the Lord at Mizpah 18 and said to them, “This is what the Lord, the God of Israel, says: ‘I brought Israel up out of Egypt, and I delivered you from the power of Egypt and all the kingdoms that oppressed you.’ 19 But you have now rejected your God, who saves you out of all your disasters and calamities. And you have said, ‘No, appoint a king over us.’
—
So it was that God appointed a king over Israel, as a judgment on their sins, which were many, giving them a ruler they deserved, a ruler, who like them was exceedingly sinful.