The Bani Quraydhah was a Jewish tribe in residing in Medinah and one of the signatories of a multilateral treaty, living alongside the Muslims. This tribe abided by the terms of the treaty, violating it during the battle of Ahzab by practically becoming one of the forces of the enemy who had surrounded the city. As a result, after the retreat of the opposing forces, the prophet (pbuh) punished them. There are hardly any differences of opinion regarding this incident between the Shia and Sunnis.
During the advent of Islam, the prophet (pbuh) and his followers were under a lot of pressure in Mekkah, and the flight of some of the Muslims then to
1- Those who lived in Medinah before the prophet’s (pbuh) migration and had turned Muslim; the great tribes of Aws and Khazraj were mostly made up of these people. These two tribes, which each were made up of smaller tribes, were named the “Ansar” [helpers] because of their aid and efforts regarding the other Muslims who had migrated to their land.
2- Those who had embraced Islam in Mekkah and had been forced out of their homeland as a result of the aggression and violence against them. This group was known as the “Muhajirin” [migrators].
3- Other Jewish tribes here and there who had migrated to Medinah and its outskirts before, because of the prophecies in their scriptures about the emergence of a prophet in it. What they had been expecting was for the promised prophet to be of the Bani Israel, but since the prophet of Islam (pbuh) was Arab and a descendant of Prophet Ismail (pbuh), it was very hard for them to accept his prophethood!
In addition to the Jewish tribes living in the outskirts of Medinah, there were also three major tribes living in Medinah itself; the “Banu Qaynuqa’”, “Banu Nadhir” and “Banu Quraydhah”.
As you can see, most of Medinah’s inhabitants were people who had willingly accepted Islam and the prophethood of Muhammad (pbuh), asking him to govern and rule it.
What the prophet (pbuh) didn’t want was for everyone to become Muslim by force, and at the same time, was worried about tensions between the Makki (Muhajirin) and Madani (Ansar) Muslims. This gave rise to him calling for a multilateral treaty between the Muhajirin, Ansar and Jews. The Jews had agreed that if they were to break their end of the treaty, their lives and wealth would be at the disposal of the prophet (pbuh).
Despite some slight tensions that were resolved by the prophet’s (pbuh) involvement, the Muhajirin and Ansar remained adherent to the terms of the treaty till the end. Yet, the treaty was gradually violated by all of the signatory Jewish tribes at different times and circumstances, which faced retaliatory measures, varying in harshness and mildness depending on how much each tribe had violated it:
2- After the “defeat” of the Muslim army in the battle of Uhud, Bani Nadhir decided to violate the treaty, sending one of their top officials, Ka’b ibn Ashraf, along with forty other people to Mekkah to meet with Abu-Sufyan, the head of the mushriks [polytheists], and plot for certain conspiracies, one of those being to murder the prophet (pbuh), which they later failed to accomplish. After learning of this violation, the prophet (pbuh) surrounded their homes and after their surrender, didn’t have them killed [although the penalty for such a conspiracy was certainly death], and only had them exiled, allowing them to take a portion of their wealth along with them [although the terms of the treaty clearly stated that in the case of violation, their wealth was to be at the disposal of the prophet (pbuh)]. A bulk of surah Hashr’s verses speaks of this group of Jews.
3- The fate of the “Banu Quraydhah” is linked with the battle of Ahzab and what happened there and then. The battle of Ahzab [The Parties] or Khandaq [Ditch] was triggered when numerous mushrik tribes, with thousands of soldiers, marched towards Medinah in order to eradicate Islam; this was their perception. After learning of such, the prophet (pbuh), with the consultation of one of his Persian companions, Salman Farsi, decided that a big ditch be dug around Medinah to protect the city. When the mushrik army arrived, it was shocked at the sight and militarily paralyzed. Medinah had become an unbreachable fortress that the army in no way could penetrate. The only plan they could come up with was to somehow get the only Jewish tribe left in Medinah, Bani Quraydhah, who had adhered to the treaty till then, on their side. The plan worked, and this tribe began to cause chaos and riots in the city. Now the Muslim nation faced two problems; an inside enemy and an outside one, making the situation worse than before, even undermining the faith of some of the believers. Nevertheless, as a result of sacrifices and efforts of individuals such as Imam Ali (as) and divine aid involving winds and typhoons, everything ended in favor of the Muslims, and the mushrik army returned without making any accomplishments.
After the retreat of the enemy, the prophet (pbuh) decided to do something about the violators of the treaty who had become one of the forces of the enemy inside the city. Subsequently, an army was sent under the command of Imam Ali (as) to where all of them resided, surrounding it for twenty-five days. Eventually, they all surrendered and there were debates on what to do with them. The Jews themselves proposed the arbitration of Sa’d ibn Ma’adh, who ruled that some of them be killed and others taken prisoner. The Quran has also mentioned this incident.
This was a brief explanation of what happened to Bani Quraydhah according to both Shias and Sunnis (with very slight variations), and one can't find much of a difference between the two, especially since there is no reason for the two to have a difference of opinion regarding the incidents.
 Tawbah:40 “...اذ اخرجه الذین کفروا ثانی اثنین ...”.
 Mohammad Baqir Majlisi, Biharul-Anwar, vol. 19, pg. 111.
 Ibid, vol. 20, pg. 1.
 Hashr:15 “کمثل الذین من قبلهم قریبا ذاقوا وبال امرهم...”
 Mohammad Baqir Majlisi, Biharul-Anwar, vol. 20, pp. 158-160.
 What is said from here on, is a summary of Biharul-Anwar, vol. 20, pp 186 and on.
 Ahzab:10-12 “اذ جاؤکم من فوقکم و من اسفل منکم و اذ زاغت الابصار و بلغت القلوب الحناجر و تظنون بالله الظنونا...”
 Ahzab:26-27 “و انزل الذین ظاهروهم من اهل الکتاب من صیاصیهم و ...”