The people wanted a king; they got a king.
As God saw it:
1 Samuel 10:18-19 I brought you from Egypt and rescued you from the Egyptians and from all of the nations that were oppressing you. But though I have rescued you from your misery and distress, you have rejected your God today and have said, ‘No, we want a king instead!’
Then after Saul led the defeat over the Ammonites:
1 Samuel 12:12-13 But when you were afraid of Nahash, the king of Ammon, you came to me and said that you wanted a king to reign over you, even though the Lord your God was already your king. All right, here is the king you have chosen. You asked for him, and the Lord has granted your request.
But it came with a warning: the king wouldn’t be able to save them from the consequences of their sin:
1 Samuel 12:22-25 The Lord will not abandon his people, because that would dishonor his great name. For it has pleased the Lord to make you his very own people. … But be sure to fear the Lord and faithfully serve him. Think of all the wonderful things he has done for you. But if you continue to sin, you and your king will be swept away.