Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:122

And it is not for the believers to go forth ˹to battle˺ all at once. For there should separate from every division of them a group ˹remaining˺ to obtain understanding in the religion and warn their people when they return to them that they might be cautious.  

When the Prophet (s) was about to dispatch a raiding party — after they ˹certain Muslims˺ had been reproached for staying behind — all of them went forth, and so the following was revealed: It is not for the believers to go forth, on a raid, altogether: why should not a party, a group, of every section, of every tribe, of them go forth, while the others remain behind, so that they, those who remain behind, may become learned in religion and that they may warn their folk when they return to them, from the raid, by teaching them some of the rulings which they have come to learn, so that they may beware? of God’s punishment, by adhering to His commands and prohibitions. Ibn ‘Abbās said that this ˹verse˺ is specifically ˹intended˺ for raiding parties, while the previous one is ˹specifically˺ to prohibit any individual staying behind when the Prophet (s) sets out ˹on a campaign˺.
القرآن:٩:١٢٢

وَمَا كَانَ الْمُؤْمِنُونَ لِيَنْفِرُوا كَافَّةً ۚ فَلَوْلَا نَفَرَ مِنْ كُلِّ فِرْقَةٍ مِنْهُمْ طَائِفَةٌ لِيَتَفَقَّهُوا فِي الدِّينِ وَلِيُنْذِرُوا قَوْمَهُمْ إِذَا رَجَعُوا إِلَيْهِمْ لَعَلَّهُمْ يَحْذَرُونَ  

ولما وبِّخوا على التخلف وأرسل النبي ﷺ سرية نفروا جميعا فنزل {وما كان المؤمنون لينفروا} إلى الغزو {كافة فلولا} فهلا {نفر من كلِّّّّ فرقة} قبيلة {منهم طائفة} جماعة، ومكث الباقون {ليتفقَّهوا} أي الماكثون {في الدين ولينذروا قومهم إذا رجعوا إليهم} من الغزو بتعليمهم ما تعلموه من الأحكام {لعلهم يحذرون} عقاب الله بامتثال أمره ونهيه، قال ابن عباس فهذه مخصوصة بالسرايا، والتي قبلها بالنهي عن تخلُّف واحد فيما إذا خرج النبي ﷺ .