Allah the Exalted here explains His order to Muslims to march forth with the Messenger of Allah ﷺ for the battle of Tabuk.
We should first mention that a group of the Salaf said that marching along with the Messenger ﷺ, when he went to battle, was at first obliged on all Muslims, because, as they say, Allah said,
انْفِرُواْ خِفَافًا وَثِقَالاً
(March forth, whether you are light or heavy) 9:41, and,
مَا كَانَ لأَهْلِ الْمَدِينَةِ وَمَنْ حَوْلَهُمْ مِّنَ الاٌّعْرَابِ
(It was not becoming of the people of Al-Madinah and the bedouins of the neighborhood...) 9:120. However, they said, Allah abrogated this ruling (9:41 and 9:120) when He revealed this Ayah, 9:122. However, we could say that this Ayah explains Allah's order to participate in battle on all Arab neighborhoods, that at least a group of every tribe should march for Jihad. Those who went with the Messenger ﷺ would gain instructions and studies in the revelation that came down to him, and warn their people about that battle when they returned to them. This way, the group that went with the Prophet will achieve both goals Jihad and learning the revelation from the Prophet . After the Prophet , a group of every tribe or neighborhood should seek religious knowledge or perform Jihad, for in this case, Jihad is required from at least a part of each Muslim community. `Ali bin Abi Talhah reported from Ibn `Abbas about the Ayah,
وَمَا كَانَ الْمُؤْمِنُونَ لِيَنفِرُواْ كَآفَّةً
(And it is not (proper) for the believers to go out (to fight - Jihad) all together. ) "The believers should not all go to battle and leave the Prophet alone,
فَلَوْلاَ نَفَرَ مِن كُلِّ فِرْقَةٍ مِّنْهُمْ طَآئِفَةٌ
(Of every troop of them, a party only should go forth) in the expeditions that the Prophet sent. When these armies returned to the Prophet, who in the meantime received revealed parts of the Qur'an from Allah, the group who remained with the Prophet would have learned that revelation from him. They would say, `Allah has revealed some parts of the Qur'an to your Prophet and we learned it.' So they learned from them what Allah revealed to His Prophet in their absence, while the Prophet sent some other men into military expeditions. Hence Allah's statement,
لِّيَتَفَقَّهُواْ فِى الدِّينِ
(that they may get instructions in religion,) so that they learn what Allah has revealed to their Prophet and teach the armies when they return,
لَعَلَّهُمْ يَحْذَرُونَ
(so that they may beware.)" Mujahid said, "This Ayah was revealed about some of the Companions of the Prophet who went to the desert and were helped by its residents, had a good rainy year and called whomever they met to guidance. The people said to them, `We see that you left your companions and came to us.' They felt bad in themselves because of this and they all came back from the desert to the Prophet . Allah said,
فَلَوْلاَ نَفَرَ مِن كُلِّ فِرْقَةٍ مِّنْهُمْ طَآئِفَةٌ
(O…