When the Israelites wanted a king, God wanted them to see Him as sufficient. But they demanded a human king. That wasn’t God’s plan but He allowed it and it led to all kinds of trouble. At least that is how I remember that part of Scripture.