Answer:
Interpreters say that at the time of Moses, the children of Israel followed the good path and remained in it for a time. However, they soon vacillated and worshipped idols . God then sent them a prophet and ordered him to call them to Him and to worship Him alone. The prophet called them to follow the right path. They asked that he should appoint a king to lead them against their enemies. So Allah appointed Saul as their king.
(Have you not seen those chiefs of the Children of Israel after Moses? They said to one of their prophets, “Appoint for us a king, ˹and˺ we will fight in the cause of Allah.” He said, “Are you not going to cower if ordered to fight?” They replied, “How could we refuse to fight in the cause of Allah, while we were driven out of our homes and ˹separated from˺ our children?” But when they were ordered to fight, they fled, except for a few of them. And Allah has ˹perfect˺ knowledge of the wrongdoers. Al-Baqara 2:246
– قَالَ المُفَسِّرُونَ إِنَّ بني إسرائيلَ كَانَوا فِي زَمَنِ مُوسَى عَلَى طَرِيقٍ مُسْتَقِيمٍ، وَلَبِثُوا عَلَى ذَلِكَ مُدَّةً مِنَ الزَّمَن. ثُمَّ تَضَعضَعَ أَمْرُهُمْ، وَعَبَدَ بَعْضُهُمُ الأوْثَانَ، وَضَاعَ المُلْكُ مِنْهُمْ. وَتَسَلَّطَ عَلَيهمْ أَعَداؤُهُمْ، فَأخْرَجُوهُمْ مِنْ دِيَارِهِمْ بِالقَهْرِ، فَأَرْسَلَ اللهُ إليْهِمْ نَبْيّاً، وَأمَرَهُ بِدِعْوَتِهِمْ إلى اللهِ، وَإلى عِبَادِةِ رَبِّهِمْ وَتَوْحِيدِهِ. فَدَعَاهُمُ النَّبِيُّ، فَطَلَبُوا مِنْهُ أنْ يُقِيمَ لَهُمْ مَلِكاً يُقَاتِلُونَ مَعَهُ أَعْدَاءَهُمْ
) أَلَمْ تَرَ إِلَى الْمَلَإِ مِن بَنِي إِسْرَائِيلَ مِن بَعْدِ مُوسَىٰ إِذْ قَالُوا لِنَبِيٍّ لَّهُمُ ابْعَثْ لَنَا مَلِكًا نُّقَاتِلْ فِي سَبِيلِ اللَّـهِ ۖ قَالَ هَلْ عَسَيْتُمْ إِن كُتِبَ عَلَيْكُمُ الْقِتَالُ أَلَّا تُقَاتِلُوا ۖ قَالُوا وَمَا لَنَا أَلَّا نُقَاتِلَ فِي سَبِيلِ اللَّـهِ وَقَدْ أُخْرِجْنَا مِن دِيَارِنَا وَأَبْنَائِنَا ۖ فَلَمَّا كُتِبَ عَلَيْهِمُ الْقِتَالُ تَوَلَّوْا إِلَّا قَلِيلًا مِّنْهُمْ ۗ وَاللَّـهُ عَلِيمٌ بِالظَّالِمِينَ ﴿٢٤٦﴾( البقرة 2:6 24