160. We divided them into twelve tribal communities. And We inspired Moses, when his people asked him for something to drink: “Strike the rock with your staff.” Whereupon twelve springs gushed from it. Each group recognized its drinking-place. And We shaded them with clouds, and We sent down upon them manna and quails: “Eat of the good things We have provided for you.” They did not wrong Us, but they used to wrong their own selves.
161. And it was said to them, “Settle this town, and eat therein whatever you wish, and speak modestly, and enter the gate in humility-We will forgive your sins, and will promote the righteous.”
162. But the wicked among them substituted other words for the words given to them; so We sent down upon them a plague from the sky, because of their wrongdoing.
163. Ask them about the town by the sea, when they violated the Sabbath. When they observed the Sabbath, their fish would come to them abundantly. But when they violated the Sabbath, their fish would not come to them. Thus We tried them because they disobeyed.
164. And when a group of them said, “Why do you counsel a people whom God will annihilate, or punish with a severe punishment?” They said, “As an excuse to your Lord, and so that they may become righteous.”
165. Then, when they neglected what they were reminded of, We saved those who prohibited evil, and We seized those who did wrong with a terrible punishment, because of their sinfulness.
166. Then, when they rebelled against the commands to refrain, We said to them, “Be despicable apes.”
167. Your Lord has announced that, He would send against them, until the Day of Resurrection, those who would inflict terrible suffering upon them. Your Lord is swift in retribution, yet He is Forgiving and Merciful.
168. And We scattered them into communities on earth. Some of them righteous, and some of them short of that. And We tested them with fortunes and misfortunes, so that they may return.
169. They were succeeded by generations who inherited the Scripture and chose the materials of this world, saying, “We will be forgiven.” And should similar materials come their way, they would again seize them. Did they not make a covenant to uphold the Scripture, and to not say about God except the truth? Did they not study its contents? But the Home of the Hereafter is better for the cautious; will you not understand?
170. Those who adhere to the Scripture, and practice prayer-We will not waste the reward of the reformers.
Muhammad is being told that after the 12 tribes split, some followed the path of God and some others did not. Some of them started to do strange worships and rituals, falsifying God’s original words to Moses. Others did not and became good believers.
These communities were each tested and given trials of hardship and to see what they would do. Some did not please God and harmed themselves, while others stuck through the hardships and remained faithful to Moses’s revelations.
Gabriel does tell Muhammad that some of the people part of the first 12 tribes of the Children of Israel have been punished for their sinfulness. While others took the teachings further and cultivated a faithful community. It is hard to know which tribe was considered the unfaithful and the faithful. But the reason Muhammad was being told this was so that he could learn how to discern between the Jews who were his friends, and the Jews who were not.
At this point in history, religion was manipulated to make the rich richer in control, and the poor poorer without control of their own lives. Islam was prescribed to the people to get back on path.
My guess is that the Pharisees that plotted to kill Jesus for the teachings he was spreading were part of the original tribe that was not listening to Moses. The Jews today that you see act as brothers with both Muslims and Christians, are part of the tribes of those who have kept the beautiful teachings alive.